Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column metadata has incorrect length/scale for domain types #1604

Closed
1 of 2 tasks
Naros opened this issue Nov 11, 2019 · 1 comment
Closed
1 of 2 tasks

Column metadata has incorrect length/scale for domain types #1604

Naros opened this issue Nov 11, 2019 · 1 comment

Comments

@Naros
Copy link

Naros commented Nov 11, 2019

I'm submitting a ...

  • bug report
  • feature request

Describe the issue
When iterating the result-set returned from DatabaseMetaData#getColumns the length and scale of a column is being reported incorrectly for columns that are based on domain types where the type modifiers are embedded in the type definition.

For example, when executing the following SQL:

CREATE DOMAIN varbit2 AS varbit(3);
CREATE TABLE test_table (pk SERIAL, value varbit2 NOT NULL, PRIMARY KEY(pk));
INSERT INTO test_table (value) values (B'101');

In this use case, I would expect that the length would have been specified as 3 but instead the value returned from the result-set is 2147483647 which does not appropriately describe the column's size constraints.

Driver Version?
42.2.8

Java Version?
8+

OS Version?
Fedora 30

PostgreSQL Version?
PG10+

To Reproduce
Steps to reproduce the behaviour:
Execute the specified SQL statements above to create the domain type varbit2 and then fetch the column metadata for table test_table.

Expected behaviour
Expected length to be 3 rather than 2147483647.

@davecramer
Copy link
Member

fixed by #1605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants