Message-ID: From: "frederikz (@frederikz)" To: "pgjdbc/pgjdbc" Date: Tue, 08 Jul 2025 10:31:57 +0000 Subject: [pgjdbc/pgjdbc] issue #3722: spring jdbc causes problems with uppercase db names since 42.7.5 List-Id: X-GitHub-Author-Id: 20817974 X-GitHub-Author-Login: frederikz X-GitHub-Issue: 3722 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: closed X-GitHub-Type: issue X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3722 Content-Type: text/plain; charset=utf-8 I'm using spring jdbc which lookups up table metadata with ``DatabaseMetaData.getTables`` and then uses the returned information to get column metadata via ``DatabaseMetaData.getColumns``. Before 42.7.5 the table metadata returned no value for ``TABLE_CAT`` and so the query for column metadata also didn't include a catalog. Since 42.7.5 the table metadata returns a value for ``TABLE_CAT`` e.g. ``abC``. Spring doesn't use this value directly. It queries ``DatabaseMetaData.storesLowerCaseIdentifiers`` which returns true and as it returns true ``abC`` is transformed to ``abc``. The query for column metadata is now done for a catalog with the name ``abc`` which doesn't return any value as an exact case match is done agains the current database name which is ``abC`` and not ``abc``. I have also reported the issue to the spring team https://github.com/spring-projects/spring-framework/issues/35064 as I'm unsure which side is causing the problem. Why does ``DatabaseMetaData.storesLowerCaseIdentifiers`` return true when database names are not treated case insensitive or if it returns true why do methods like ``DatabaseMetaData.getColumns`` not accept lowercase names for a database? I would expect ``DatabaseMetaData.storesLowerCaseIdentifiers`` to return false or methods like ``DatabaseMetaData.getColumns`` to accecpt a lowercase database name even if the database name was created with uppercase letters.