1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-13 16:22:44 +03:00

Add PQfullProtocolVersion() to surface the precise protocol version.

The existing function PQprotocolVersion() does not include the minor
version of the protocol.  In preparation for pending work that will
bump that number for the first time, add a new function to provide it
to clients that may care, using the (major * 10000 + minor)
convention already used by PQserverVersion().

Jacob Champion based on earlier work by Jelte Fennema-Nio

Discussion: http://postgr.es/m/CAOYmi+mM8+6Swt1k7XsLcichJv8xdhPnuNv7-02zJWsezuDL+g@mail.gmail.com
This commit is contained in:
Robert Haas
2024-09-09 11:54:55 -04:00
parent 5bbdfa8a18
commit cdb6b0fdb0
4 changed files with 47 additions and 9 deletions

View File

@@ -7158,6 +7158,16 @@ PQprotocolVersion(const PGconn *conn)
return PG_PROTOCOL_MAJOR(conn->pversion);
}
int
PQfullProtocolVersion(const PGconn *conn)
{
if (!conn)
return 0;
if (conn->status == CONNECTION_BAD)
return 0;
return PG_PROTOCOL_FULL(conn->pversion);
}
int
PQserverVersion(const PGconn *conn)
{