What's the meaning of the COLUMN_SIZE 131089 for NUMERIC types without precision? #2187
-
Running this: try (Statement s = connection.createStatement()) {
try {
s.executeUpdate("create table t (implicit_precision numeric)");
try (ResultSet rs = connection.getMetaData().getColumns(null, "public", "t", "%")) {
while (rs.next()) {
System.out.println(rs.getInt(7));
}
}
}
finally {
s.executeUpdate("drop table if exists t");
}
} Produces a value of What is the meaning of this value? I would have expected this to produce select *
from information_schema.columns
where table_name = 't'; Is it safe to assume that this value won't change and I can rely on it to mean |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Asking if something will never change is probably a mistake. To be honest I will have to do some research to see why we used that number. For now I would expect you can assume it won't change. |
Beta Was this translation helpful? Give feedback.
-
Ok, so length refers to precision in Numeric. Why would you think it should be 0 or NULL ? |
Beta Was this translation helpful? Give feedback.
-
Ok, the real issue is AFAICT this is wrong! Now fixing it may be a challenge, but I've created issue #2188 Thanks for the report |
Beta Was this translation helpful? Give feedback.
Ok, the real issue is
pgjdbc/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java
Line 1650 in 7aea513
AFAICT this is wrong!
Now fixing it may be a challenge, but I've created issue #2188
Thanks for the report