summaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-protocol2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/libpq/fe-protocol2.c')
-rw-r--r--src/interfaces/libpq/fe-protocol2.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/interfaces/libpq/fe-protocol2.c b/src/interfaces/libpq/fe-protocol2.c
index 8c214fa8e92..369481b3386 100644
--- a/src/interfaces/libpq/fe-protocol2.c
+++ b/src/interfaces/libpq/fe-protocol2.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-protocol2.c,v 1.9 2003/11/29 19:52:12 pgsql Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-protocol2.c,v 1.10 2004/03/05 01:53:59 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -178,7 +178,9 @@ pqSetenvPoll(PGconn *conn)
* default in a 7.3 server.
*
* Note: version() exists in all
- * protocol-2.0-supporting backends.
+ * protocol-2.0-supporting backends. In 7.3 it would
+ * be safer to write pg_catalog.version(), but we can't
+ * do that without causing problems on older versions.
*/
if (!PQsendQuery(conn, "begin; select version(); end"))
goto error_return;
@@ -258,8 +260,9 @@ pqSetenvPoll(PGconn *conn)
* in 7.3 servers where we need to prevent
* autocommit-off from starting a transaction anyway.
*/
- if (strncmp(conn->sversion, "7.3", 3) == 0)
- query = "begin; select pg_client_encoding(); end";
+ if (conn->sversion >= 70300 &&
+ conn->sversion < 70400)
+ query = "begin; select pg_catalog.pg_client_encoding(); end";
else
query = "select pg_client_encoding()";
if (!PQsendQuery(conn, query))