mirror of
https://github.com/postgres/postgres.git
synced 2025-07-20 05:03:10 +03:00
libpq's query to get the OIDs of large-object support functions was not
schema-safe. Make it so, and improve the internal support for knowledge of server version.
This commit is contained in:
@ -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))
|
||||
|
Reference in New Issue
Block a user