From: Thomas G. Lockhart Date: Sat, 15 Aug 1998 06:56:36 +0000 (+0000) Subject: Update for new information on PQsetNoticeProcessor(). X-Git-Tag: REL9_0_0~26789 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a9e9f59308a14856921bfcfb41b2bee1f531de8a;p=pg-rex%2Fsyncrep.git Update for new information on PQsetNoticeProcessor(). Now back in sync with libpq.3 man page, which should be obsolete soon. --- diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index b165e1d91f..6fe77dbcde 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -129,8 +129,8 @@ sets the default cost for indexed searches for the optimizer. -See the set(l) -man page for information on the arguments for these environment variables. +Refer to the SET SQL command +for information on the arguments for these environment variables. @@ -1074,6 +1074,49 @@ void PQuntrace(PGconn *conn) + +<FileName>libpq</FileName> Control Functions + + + + + +PQsetNoticeProcessor +Control reporting of notice and warning messages generated by libpq. + +void PQsetNoticeProcessor (PGconn * conn, + void (*noticeProcessor) (void * arg, const char * message), + void * arg) + + + + + + + +By default, libpq prints "notice" messages from the backend on stderr, +as well as a few error messages that it generates by itself. +This behavior can be overridden by supplying a callback function that +does something else with the messages. The callback function is passed +the text of the error message (which includes a trailing newline), plus +a void pointer that is the same one passed to PQsetNoticeProcessor. +(This pointer can be used to access application-specific state if needed.) +The default notice processor is simply + +static void +defaultNoticeProcessor(void * arg, const char * message) +{ + fprintf(stderr, "%s", message); +} + + + +To use a special notice processor, call PQsetNoticeProcessor just after +any creation of a new PGconn object. + + + + User Authentication Functions @@ -1124,7 +1167,7 @@ void fe_setauthsvc(char *name, -BUGS +Caveats The query buffer is 8192 bytes long, and queries over