-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Using CockroachDB with Postgres JDBC driver causes failure because of database version #43703
Comments
Hello, It seems the documentation contradicts itself:
So... does this work?
If so, we'll need to update the documentation. If not, and if we want |
@yrodiere Will try with your example and report back. |
Same result. For some reason it seems to ignore the |
Thanks for trying. Then this is what we should do:
In the meantime, I will send a PR to:
|
Done here: #43762 With that PR, your initial configuration should work without a problem (but the DB version won't be checked):
|
Describe the bug
When using CockroachDB with Postgres JDBC driver, there is a version mismatch in the minimum database version required by the
CockroachDialect
and the database version reported by theDatabaseMetaData
from the driver. This causes a failure at startup when building the Hibernate SessionFactory.Expected behavior
Hibernate SessionFactory should be created without issues.
Actual behavior
How to Reproduce?
Use this example https://quarkus.io/guides/hibernate-orm with the
3.15.1
version of quarkus, specifying cockroachOutput of
uname -a
orver
Linux miramar-001 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
java version "21.0.3" 2024-04-16 LTS Java(TM) SE Runtime Environment (build 21.0.3+7-LTS-152) Java HotSpot(TM) 64-Bit Server VM (build 21.0.3+7-LTS-152, mixed mode, sharing)
Quarkus version or git rev
3.15.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven home: /home/garth/.m2/wrapper/dists/apache-maven-3.9.8/af622e91 Java version: 21.0.3, vendor: Oracle Corporation, runtime: /usr/lib/jvm/jdk-21-oracle-x64 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "6.8.0-45-generic", arch: "amd64", family: "unix"
Additional information
It looks like the issue is that the JDBC driver (or Cockroach) is returning
13.0.0
for the postgres version that it is compatible with, rather than the actual Cockroach version (because aselect version()
returns the right value).It seems like this enforcement of minimum versions is new. Is there a workaround? Or a way to disable the enforcement? Or a way to tell it what version the database is?
The text was updated successfully, but these errors were encountered: