pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: monclaf (@monclaf) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #3731: Entity Manager Creation issue with jdbc driver > 42.7.4
Date: Tue, 19 Aug 2025 15:25:18 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

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.

<img width="1860" height="844" alt="Image" src="https://github.com/user-attachments/assets/c11a53a2-5903-4483-b059-cb493a26c6ad"; />

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

view thread (21+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] issue #3731: Entity Manager Creation issue with jdbc driver > 42.7.4
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox