return "CockroachDB"
@property
- def crdb_version(self) -> int:
+ def server_version(self) -> int:
"""
Return the CockroachDB server version connected.
- Return None if the server is not CockroachDB, else return a number in
- the PostgreSQL format (e.g. 21.2.10 -> 200210)
-
- Assume all the connections are on the same db: return a cached result on
- following calls.
+ Return a number in the PostgreSQL format (e.g. 21.2.10 -> 200210)
"""
sver = self.parameter_status("crdb_version")
if not sver:
assert conn.info.vendor == "CockroachDB"
-def test_crdb_version(conn):
- assert conn.info.crdb_version > 200000
+def test_server_version(conn):
+ assert conn.info.server_version > 200000
def test_backend_pid(conn):
assert tz and isinstance(tz, str)
assert tz == conn.execute("show timezone").fetchone()[0]
+ @pytest.mark.crdb("skip")
def test_server_version(self, conn):
assert conn.info.server_version == conn.pgconn.server_version
version = f"{num // 10000}.{num % 100}"
elif conn.info.vendor == "CockroachDB":
assert isinstance(conn, CrdbConnection)
- num = conn.info.crdb_version
+ num = conn.info.server_version
version = f"{num // 10000}.{num % 10000 // 100}.{num % 100}"
else:
raise NotImplementedError(f"unexpected vendor: {conn.info.vendor}")