PQserverVersion - Mailing list pgsql-patches
From | Greg Sabino Mullane |
---|---|
Subject | PQserverVersion |
Date | |
Msg-id | b690f4dcd8505c365b2f89a9819480d1@biglumber.com Whole thread Raw |
Responses |
Re: PQserverVersion
Re: PQserverVersion Re: PQserverVersion |
List | pgsql-patches |
Index: doc/src/sgml/libpq.sgml =================================================================== RCS file: /projects/cvsroot/pgsql-server/doc/src/sgml/libpq.sgml,v retrieving revision 1.157 diff -c -r1.157 libpq.sgml *** doc/src/sgml/libpq.sgml 8 Jun 2004 13:49:22 -0000 1.157 --- doc/src/sgml/libpq.sgml 10 Aug 2004 15:48:59 -0000 *************** *** 894,899 **** --- 894,916 ---- </listitem> </varlistentry> + <varlistentry> + <term><function>PQserverVersion</function><indexterm><primary>PQserverVersion</></></term> + <listitem> + <para> + Returns an integer representing the backend version. + <synopsis> + int PQseverVersion(const PGconn *conn); + </synopsis> + Applications may use this to determine which version of the database they are + connecting to. The number is formed by converting the major, minor, and revision + numbers into two digit numbers and appending them together. For example, version + 7.4.2 will be returned as 70402, and version 8.1 will be returned as 80100 + (leading zeroes are not shown). + </para> + </listitem> + </varlistentry> + <varlistentry> <term><function>PQerrorMessage</function><indexterm><primary>PQerrorMessage</></></term> <listitem> Index: src/interfaces/libpq/blibpqdll.def =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/interfaces/libpq/blibpqdll.def,v retrieving revision 1.9 diff -c -r1.9 blibpqdll.def *** src/interfaces/libpq/blibpqdll.def 13 Aug 2003 16:29:03 -0000 1.9 --- src/interfaces/libpq/blibpqdll.def 10 Aug 2004 15:49:00 -0000 *************** *** 113,118 **** --- 113,120 ---- _PQfformat @ 109 _PQexecPrepared @ 110 _PQsendQueryPrepared @ 111 + _PQdsplen @ 112 + _PQseverVersion @ 113 ; Aliases for MS compatible names PQconnectdb = _PQconnectdb *************** *** 226,228 **** --- 228,232 ---- PQfformat = _PQfformat PQexecPrepared = _PQexecPrepared PQsendQueryPrepared = _PQsendQueryPrepared + PQdsplen = _PQdsplen + PQserverVersion = _PQserverVersion Index: src/interfaces/libpq/fe-connect.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/interfaces/libpq/fe-connect.c,v retrieving revision 1.278 diff -c -r1.278 fe-connect.c *** src/interfaces/libpq/fe-connect.c 12 Jul 2004 14:23:28 -0000 1.278 --- src/interfaces/libpq/fe-connect.c 10 Aug 2004 15:49:00 -0000 *************** *** 2872,2877 **** --- 2872,2887 ---- return PG_PROTOCOL_MAJOR(conn->pversion); } + int + PQserverVersion(const PGconn *conn) + { + if (!conn) + return 0; + if (conn->status == CONNECTION_BAD) + return 0; + return conn->sversion; + } + char * PQerrorMessage(const PGconn *conn) { Index: src/interfaces/libpq/libpq-fe.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/interfaces/libpq/libpq-fe.h,v retrieving revision 1.104 diff -c -r1.104 libpq-fe.h *** src/interfaces/libpq/libpq-fe.h 24 Mar 2004 03:44:59 -0000 1.104 --- src/interfaces/libpq/libpq-fe.h 10 Aug 2004 15:49:00 -0000 *************** *** 248,253 **** --- 248,254 ---- extern const char *PQparameterStatus(const PGconn *conn, const char *paramName); extern int PQprotocolVersion(const PGconn *conn); + extern int PQserverVersion(const PGconn *conn); extern char *PQerrorMessage(const PGconn *conn); extern int PQsocket(const PGconn *conn); extern int PQbackendPID(const PGconn *conn); Index: src/interfaces/libpq/libpqddll.def =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/interfaces/libpq/libpqddll.def,v retrieving revision 1.1 diff -c -r1.1 libpqddll.def *** src/interfaces/libpq/libpqddll.def 9 Mar 2004 04:53:37 -0000 1.1 --- src/interfaces/libpq/libpqddll.def 10 Aug 2004 15:49:00 -0000 *************** *** 113,115 **** --- 113,117 ---- PQfformat @ 109 PQexecPrepared @ 110 PQsendQueryPrepared @ 111 + PQdsplen @ 112 + PQserverVersion @ 113 Index: src/interfaces/libpq/libpqdll.def =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/interfaces/libpq/libpqdll.def,v retrieving revision 1.25 diff -c -r1.25 libpqdll.def *** src/interfaces/libpq/libpqdll.def 5 Apr 2004 03:16:21 -0000 1.25 --- src/interfaces/libpq/libpqdll.def 10 Aug 2004 15:49:00 -0000 *************** *** 114,116 **** --- 114,117 ---- PQexecPrepared @ 110 PQsendQueryPrepared @ 111 PQdsplen @ 112 + PQserverVersion @ 113
pgsql-patches by date: