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
PgDatabaseMetaData should return column names as described in specification. #830
Comments
PostgreSQL by default folds to lower case. This would probably break everyone elses code. Pretty sure this is a non-starter |
Then this issue could be closed. |
@davecramer , technically speaking, "TABLE_CAT, TABLE_SCHEM, TABLE_NAME, ..." are declared to be in upper case (not the contents, but the column names itself)
Do you still consider it is not possible to adjust that? |
I assumed he wanted the actually names of the columns returned in upper case ? ie create table (id int, a text) would return column names id, and a in lower case. Is this not the case ? |
@davecramer no, as @vlsi described specifications is telling about "TABLE_CAT, TABLE_SCHEM, TABLE_NAME, ..." as uppercase. So I expect column names to be returned in upper case also. |
Implementation-wise, |
This would not be difficult to fix. Just double quote the table names above. At this point I'm wondering what it would break ? |
Lower case is visible via However, metadata-API is always a pain, so we might want to add a kill switch. That is: make upper case the default (e.g. in 42.1.2+), add a connection property to flip back the case, and remove the switch in (42.2.0). |
@davecramer , do you think a kill switch is required? |
@vlsi yes, I do, as this is a behavioural change. |
This should be changed. Some applications use jdbc drivers and read the columns from the metadata. |
Hi @davecramer , I'm trying to integrate a postgresql database with SAP JAVA BI (currently have MySQL, MSSQL and others running with JDBC drivers). After some digging I found that the code used to determine database tables:
As you can see, the column names are fetched using Unfortunately I can't control the existing SAP code. Any thoughts? Thanks |
@EcoFreak it would appear we need to fix the ResultSetMetaData as well. Pull requests are welcome |
pgjdbc#2092) * fix: PgDatabaseMetaData should return UPPERCASE column names as per spec, fixes pgjdbc#830 * fix javadoc errors
Hello,
In java specification for getTables are returned column names uppercased. As many implementations depends on this, would it be possible to convert values to uppercase and provide it as described in specification? I know that it's possible to retrieve resultset metadata with ignoringcase but when you don't have this in mind, it could produce errors.
Thanks
The text was updated successfully, but these errors were encountered: