aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas G. Lockhart <lockhart@fourpalms.org>1998-08-15 06:56:36 +0000
committerThomas G. Lockhart <lockhart@fourpalms.org>1998-08-15 06:56:36 +0000
commita9e9f59308a14856921bfcfb41b2bee1f531de8a (patch)
tree221e1f4d2a37333f8936166b133760a0c8318047
parentc4bf0c0d6a276df017a1f80ac9fe18978e441bc0 (diff)
downloadpostgresql-a9e9f59308a14856921bfcfb41b2bee1f531de8a.tar.gz
postgresql-a9e9f59308a14856921bfcfb41b2bee1f531de8a.zip
Update for new information on PQsetNoticeProcessor().
Now back in sync with libpq.3 man page, which should be obsolete soon.
-rw-r--r--doc/src/sgml/libpq.sgml49
1 files changed, 46 insertions, 3 deletions
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index b165e1d91f5..6fe77dbcde7 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.
</Para>
<Para>
-See the set(l)
-man page for information on the arguments for these environment variables.
+Refer to the <command>SET</command> <acronym>SQL</acronym> command
+for information on the arguments for these environment variables.
</Sect1>
@@ -1074,6 +1074,49 @@ void PQuntrace(PGconn *conn)
</Sect1>
<Sect1>
+<Title>
+<FileName>libpq</FileName> Control Functions</Title>
+
+<Para>
+<ItemizedList>
+<ListItem>
+<Para>
+<Function>PQsetNoticeProcessor</Function>
+Control reporting of notice and warning messages generated by libpq.
+<ProgramListing>
+void PQsetNoticeProcessor (PGconn * conn,
+ void (*noticeProcessor) (void * arg, const char * message),
+ void * arg)
+</ProgramListing>
+</Para>
+</ListItem>
+</ItemizedList>
+</Para>
+
+<Para>
+By default, <filename>libpq</filename> 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 <function>PQsetNoticeProcessor</function>.
+(This pointer can be used to access application-specific state if needed.)
+The default notice processor is simply
+<ProgramListing>
+static void
+defaultNoticeProcessor(void * arg, const char * message)
+{
+ fprintf(stderr, "%s", message);
+}
+</ProgramListing>
+
+<Para>
+To use a special notice processor, call <function>PQsetNoticeProcessor</function> just after
+any creation of a new PGconn object.
+
+</Sect1>
+
+<Sect1>
<Title>User Authentication Functions</Title>
<Para>
@@ -1124,7 +1167,7 @@ void fe_setauthsvc(char *name,
</Sect1>
<Sect1>
-<Title>BUGS</Title>
+<Title>Caveats</Title>
<Para>
The query buffer is 8192 bytes long, and queries over