Skip to content

Commit 4a240b0

Browse files
committed
Add comment why getDataLength return value change 131089 to 0
1 parent 5bfe0e8 commit 4a240b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

embulk-output-postgresql/src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnection.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ protected String buildColumnTypeName(JdbcColumn c)
267267
if (c.getDataLength() > MAX_NUMERIC_PRECISION || c.getDataLength() < MIN_NUMERIC_PRECISION) {
268268
// getDataLength for numeric without precision will return 0 or 131089 .
269269
// but cannot create column of numeric(0) and numeric(131089) .
270+
// before PostgreSQL JDBC driver 42.2.23, return 131089. from 42.2.23 return 0.
271+
// release note: https://jdbc.postgresql.org/changelogs/2021-07-06-42.2.23-release/
272+
// issue: https://github.com/pgjdbc/pgjdbc/issues/2188
273+
// pull request: https://github.com/pgjdbc/pgjdbc/pull/2189
270274
return "NUMERIC";
271275
}
272276
break;

0 commit comments

Comments
 (0)