From 72a2cd708936db8a96fa7b528e3713aab82570f7 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 10 May 1999 15:27:19 +0000 Subject: [PATCH] libpq++ uses fe_setauthsvc which is deprecated and results in an error on connection. This patch changes it to use PQconnectdb rather than {fe_setauthsvc,PQsetdb}. This still isn't the complete solution, as there is no provision for user,password in class PgEnv, but it does get rid of the error message. Tested with gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release) under NetBSD-1.3K/i386. Cheers, Patrick Welche --- doc/src/sgml/libpq.sgml | 2 +- src/interfaces/libpq++/pgconnection.cc | 22 ++++++++++------------ src/interfaces/libpq++/pgenv.cc | 16 ++++++++++++++++ src/interfaces/libpq++/pgenv.h | 2 ++ 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index cbde3387fc..3442185fd4 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -316,7 +316,7 @@ char *PQoptions(PGconn *conn) Returns the status of the connection. The status can be CONNECTION_OK or CONNECTION_BAD. -ConnStatusType *PQstatus(PGconn *conn) +ConnStatusType PQstatus(PGconn *conn) diff --git a/src/interfaces/libpq++/pgconnection.cc b/src/interfaces/libpq++/pgconnection.cc index c650891f8d..24ee0aa2a7 100644 --- a/src/interfaces/libpq++/pgconnection.cc +++ b/src/interfaces/libpq++/pgconnection.cc @@ -17,6 +17,7 @@ #include #include +#include #include "pgconnection.h" extern "C" { @@ -88,21 +89,18 @@ ConnStatusType PgConnection::Connect(const char* dbName) PQtrace(pgConn, debug); #endif - // Set Host Authentication service - char errorMessage[ERROR_MSG_LENGTH]; - memset(errorMessage, 0, sizeof(errorMessage)); - fe_setauthsvc(pgEnv.Auth(), errorMessage); - // Connect to the database - pgConn = PQsetdb(pgEnv.Host(), pgEnv.Port(), pgEnv.Option(), pgEnv.TTY(), dbName); + ostrstream conninfo; + conninfo << "dbname="<