1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-26 12:21:12 +03:00

Add PQlibVersion() function to libpq

This function is like the PQserverVersion() function except
it returns the version of libpq, making it possible for a client
program or driver to determine which version of libpq is in
use at runtime, and not just at link time.

Suggested by Harald Armin Massa and several others.
This commit is contained in:
Magnus Hagander
2010-12-22 14:23:56 +01:00
parent 32ba2b5160
commit de9a4c27fe
4 changed files with 56 additions and 0 deletions

View File

@ -66,6 +66,14 @@ static int pqSocketCheck(PGconn *conn, int forRead, int forWrite,
time_t end_time);
static int pqSocketPoll(int sock, int forRead, int forWrite, time_t end_time);
/*
* PQlibVersion: return the libpq version number
*/
int
PQlibVersion(void)
{
return PG_VERSION_NUM;
}
/*
* fputnbytes: print exactly N bytes to a file