pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
[pgjdbc/pgjdbc] issue #3527: Improve compatibility with non-Postgres databases
4+ messages / 2 participants
[nested] [flat]

* [pgjdbc/pgjdbc] issue #3527: Improve compatibility with non-Postgres databases
@ 2025-02-18 16:10 "kneth (@kneth)" <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: kneth (@kneth) @ 2025-02-18 16:10 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

Postgres compatible databases like https://github.com/crate/crate can use PG JDBC as driver. Often the PG JDBC driver is used by a tool or integration (JetBrains DataGrip to name one). As CrateDB isn't fully PG compatible, and hopefully the PG JDBC can offer a more robust support. The issue has also been reported as https://github.com/crate/crate/issues/17393.

A patch to work around the differences between the two databases can be found in https://github.com/pgjdbc/pgjdbc/pull/3526.

**Describe the issue**

As far as I can see, a query as `SELECT current_database()` will return a different column name. For Postgres, the column name will be `current_database` while for CrateDB, the column name will be the name of the current database. The PG JDBC driver will try to access the column `current_database` - which does not exist in the CrateDB case (leading to an error or exception).

It means that https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMeta... will fail as the column name is not specified in https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMeta... .

**Driver Version?** 

42.7.5

**Java Version?**

**OS Version?**

**PostgreSQL Version?**


**To Reproduce**

Any query with `current_database()` with the minimal case `SELECT current_database()`.

**Expected behaviour**

The driver should not throw an exception.

**Logs**

The following two screenshots show the difference between Postgres and CrateDB.

![Image](https://github.com/user-attachments/assets/910c468f-3bec-4ada-8e60-0f3041ba6f28)

![Image](https://github.com/user-attachments/assets/ddc71437-23c1-4ad5-a188-1f4829fac85e)

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [pgjdbc/pgjdbc] issue #3527: Improve compatibility with non-Postgres databases
@ 2025-02-24 07:28 ` "vlsi (@vlsi)" <[email protected]>
  2 siblings, 0 replies; 4+ messages in thread

From: vlsi (@vlsi) @ 2025-02-24 07:28 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

@kneth , do you know if there's a possibility to execute basic crate tests in pgjdbc CI?
I guess we might consider including it if the tests are not too flaky.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [pgjdbc/pgjdbc] issue #3527: Improve compatibility with non-Postgres databases
@ 2025-02-24 09:17 ` "kneth (@kneth)" <[email protected]>
  2 siblings, 0 replies; 4+ messages in thread

From: kneth (@kneth) @ 2025-02-24 09:17 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

@vlsi It is definitely possible as we done it in https://github.com/crate/crate-qa/tree/master/tests/client_tests/stock_jdbc. We discovered the issue when [upgrading to 42.7.5](https://github.com/crate/crate-qa/pull/333) using our tests.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [pgjdbc/pgjdbc] issue #3527: Improve compatibility with non-Postgres databases
@ 2025-04-25 13:38 ` "kneth (@kneth)" <[email protected]>
  2 siblings, 0 replies; 4+ messages in thread

From: kneth (@kneth) @ 2025-04-25 13:38 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

As #3526 has been merged, I close the issue as completed.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2025-04-25 13:38 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-02-18 16:10 [pgjdbc/pgjdbc] issue #3527: Improve compatibility with non-Postgres databases "kneth (@kneth)" <[email protected]>
2025-02-24 07:28 ` "vlsi (@vlsi)" <[email protected]>
2025-02-24 09:17 ` "kneth (@kneth)" <[email protected]>
2025-04-25 13:38 ` "kneth (@kneth)" <[email protected]>

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