1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Change pqInternalNotice to accept a format string and args instead of

just a preformatted message; per suggestion by Sean Chittenden.
This commit is contained in:
Tom Lane
2003-06-23 19:20:25 +00:00
parent 408625321c
commit ab5c775116
7 changed files with 70 additions and 79 deletions

View File

@ -23,7 +23,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.97 2003/06/21 21:51:34 tgl Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.98 2003/06/23 19:20:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -206,7 +206,6 @@ pqGetInt(int *result, size_t bytes, PGconn *conn)
{
uint16 tmp2;
uint32 tmp4;
char noticeBuf[64];
switch (bytes)
{
@ -225,10 +224,9 @@ pqGetInt(int *result, size_t bytes, PGconn *conn)
*result = (int) ntohl(tmp4);
break;
default:
snprintf(noticeBuf, sizeof(noticeBuf),
libpq_gettext("integer of size %lu not supported by pqGetInt"),
(unsigned long) bytes);
PGDONOTICE(conn, noticeBuf);
pqInternalNotice(&conn->noticeHooks,
"integer of size %lu not supported by pqGetInt",
(unsigned long) bytes);
return EOF;
}
@ -248,7 +246,6 @@ pqPutInt(int value, size_t bytes, PGconn *conn)
{
uint16 tmp2;
uint32 tmp4;
char noticeBuf[64];
switch (bytes)
{
@ -263,10 +260,9 @@ pqPutInt(int value, size_t bytes, PGconn *conn)
return EOF;
break;
default:
snprintf(noticeBuf, sizeof(noticeBuf),
libpq_gettext("integer of size %lu not supported by pqPutInt"),
(unsigned long) bytes);
PGDONOTICE(conn, noticeBuf);
pqInternalNotice(&conn->noticeHooks,
"integer of size %lu not supported by pqPutInt",
(unsigned long) bytes);
return EOF;
}