Index: src/interfaces/libpq/fe-connect.c =================================================================== RCS file: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v retrieving revision 1.182 diff -c -r1.182 fe-connect.c *** src/interfaces/libpq/fe-connect.c 2 Mar 2002 00:49:22 -0000 1.182 --- src/interfaces/libpq/fe-connect.c 3 Mar 2002 02:33:51 -0000 *************** *** 1296,1301 **** --- 1296,1310 ---- return PGRES_POLLING_READING; } + /* Grab NOTICE/INFO/DEBUG and discard them. */ + while (beresp == 'N') + { + if (getNotice(conn)) + return PGRES_POLLING_READING; + if (pqGetc(&beresp, conn)) + return PGRES_POLLING_READING; + } + /* Handle errors. */ if (beresp == 'E') { *************** *** 1314,1319 **** --- 1323,1337 ---- */ appendPQExpBufferChar(&conn->errorMessage, '\n'); goto error_return; + } + + /* Grab NOTICE/INFO/DEBUG and discard them. */ + while (beresp == 'N') + { + if (getNotice(conn)) + return PGRES_POLLING_READING; + if (pqGetc(&beresp, conn)) + return PGRES_POLLING_READING; } /* Otherwise it should be an authentication request. */ Index: src/interfaces/libpq/fe-exec.c =================================================================== RCS file: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v retrieving revision 1.113 diff -c -r1.113 fe-exec.c *** src/interfaces/libpq/fe-exec.c 25 Oct 2001 05:50:13 -0000 1.113 --- src/interfaces/libpq/fe-exec.c 3 Mar 2002 02:33:52 -0000 *************** *** 54,60 **** static int getRowDescriptions(PGconn *conn); static int getAnotherTuple(PGconn *conn, int binary); static int getNotify(PGconn *conn); - static int getNotice(PGconn *conn); /* --------------- * Escaping arbitrary strings to get valid SQL strings/identifiers. --- 54,59 ---- *************** *** 1379,1385 **** * Exit: returns 0 if successfully consumed Notice message. * returns EOF if not enough data. */ ! static int getNotice(PGconn *conn) { /* --- 1378,1384 ---- * Exit: returns 0 if successfully consumed Notice message. * returns EOF if not enough data. */ ! int getNotice(PGconn *conn) { /* Index: src/interfaces/libpq/libpq-fe.h =================================================================== RCS file: /cvsroot/pgsql/src/interfaces/libpq/libpq-fe.h,v retrieving revision 1.80 diff -c -r1.80 libpq-fe.h *** src/interfaces/libpq/libpq-fe.h 8 Nov 2001 20:37:52 -0000 1.80 --- src/interfaces/libpq/libpq-fe.h 3 Mar 2002 02:33:56 -0000 *************** *** 252,257 **** --- 252,258 ---- extern size_t PQescapeString(char *to, const char *from, size_t length); extern unsigned char *PQescapeBytea(unsigned char *bintext, size_t binlen, size_t *bytealen); + extern int getNotice(PGconn *conn); /* Simple synchronous query */ extern PGresult *PQexec(PGconn *conn, const char *query);