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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user