Message-ID: From: "monclaf (@monclaf)" To: "pgjdbc/pgjdbc" Date: Tue, 19 Aug 2025 15:25:18 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #3731: Entity Manager Creation issue with jdbc driver > 42.7.4 In-Reply-To: References: List-Id: X-GitHub-Author-Login: monclaf X-GitHub-Comment-Id: 3201217287 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3731 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3731#issuecomment-3201217287 Content-Type: text/plain; charset=utf-8 Hi @davecramer I think I've found the issue in openjpa. I did compare version v42.7.4 and v42.7.5 and I noticed that a filter was added in the getColumns based on sql function 'current_database()' that always return value with case sensitive. The jdbc property 'schemaCase' set to 'preserve' in openjpa (via persistence.xml) change the tablename and force it to uppercase. So when in v42.7.4 you have only one filter 'lower' (default value) is working for tablename filter, but in v42.7.5, 'lower' value does not work for 'current_database()' test with 'catalog' that is case depending of schemaCase, and 'preserve' and 'upper' values make tablename filter fails. (in my case table name is uppercase and tablename is lowercase (automatic generation)). So I wait for confirmation from openjpa to open a ticket on their side. Image From these analysis, even, if there is an issue on openjpa, I wonder if it would be another issue on PostgreSQL JDBC driver, I explain. In the following test of the getColums method of PgDatabaseMetaData : ` if (catalog != null) { sql += " AND current_database() = " + escapeQuotes(catalog); }` currrent_database() result from PosgreSQL database is always case sensitive, but because 'catalog' is schema case dependant it will match 'current_database()' only if 'preserve' schema case is set, otherwise it will depend on the fact the database name is all upper case or all lower case. Wouldn't be better to get the 'current_database()' value and to apply schema case on it before to execute the query ? Thanks, Fred