Compare commits

..

No commits in common. "78c832eb1f3faacc7bd1c7ae9996f283ef69637c" and "f632a77e8e56be801c3229333afec497f391e3fb" have entirely different histories.

View File

@ -208,15 +208,6 @@ public class jrunner {
} }
try { try {
scon = DriverManager.getConnection(scu, scn, scp); scon = DriverManager.getConnection(scu, scn, scp);
// Migration mode only: PostgreSQL ignores setFetchSize unless autoCommit
// is false without this it buffers the ENTIRE result set into memory
// (OOM on big tables). The migration source is read-only, so never
// committing is harmless. Do NOT do this in query mode: callers run
// committed DDL/DML through query mode, and autoCommit=false would roll
// those statements back on connection close.
if (!queryMode) {
scon.setAutoCommit(false);
}
} catch (SQLException e) { } catch (SQLException e) {
System.out.println("issue connecting to source:"); System.out.println("issue connecting to source:");
e.printStackTrace(); e.printStackTrace();
@ -311,16 +302,7 @@ public class jrunner {
nr = ""; nr = "";
for (int i = 1; i <= cols; i++){ for (int i = 1; i <= cols; i++){
switch (dtn[i].toUpperCase()){ switch (dtn[i].toUpperCase()){
// PG string-ish types that otherwise fall to the default
// case and get emitted UNQUOTED (breaking the INSERT):
// jsonb/json carry embedded quotes, bpchar is PG's char(n),
// uuid is a quoted literal. Quote them like varchar.
case "JSON":
case "JSONB":
case "BPCHAR":
case "UUID":
case "VARCHAR": case "VARCHAR":
case "NVARCHAR":
nc = rs.getString(i); nc = rs.getString(i);
if (rs.wasNull() || nc == null) { if (rs.wasNull() || nc == null) {
nc = "NULL"; nc = "NULL";
@ -331,7 +313,6 @@ public class jrunner {
nc = "'" + nc + "'"; nc = "'" + nc + "'";
break; break;
case "TEXT": case "TEXT":
case "NTEXT":
nc = rs.getString(i); nc = rs.getString(i);
if (rs.wasNull() || nc == null) { if (rs.wasNull() || nc == null) {
nc = "NULL"; nc = "NULL";
@ -342,7 +323,6 @@ public class jrunner {
nc = "'" + nc + "'"; nc = "'" + nc + "'";
break; break;
case "CHAR": case "CHAR":
case "NCHAR":
nc = rs.getString(i); nc = rs.getString(i);
if (rs.wasNull() || nc == null) { if (rs.wasNull() || nc == null) {
nc = "NULL"; nc = "NULL";
@ -353,7 +333,6 @@ public class jrunner {
nc = "'" + nc + "'"; nc = "'" + nc + "'";
break; break;
case "CLOB": case "CLOB":
case "NCLOB":
nc = rs.getString(i); nc = rs.getString(i);
if (rs.wasNull() || nc == null) { if (rs.wasNull() || nc == null) {
nc = "NULL"; nc = "NULL";