summaryrefslogtreecommitdiff
path: root/src/man
diff options
context:
space:
mode:
Diffstat (limited to 'src/man')
-rw-r--r--src/man/libpq.334
1 files changed, 32 insertions, 2 deletions
diff --git a/src/man/libpq.3 b/src/man/libpq.3
index d26799e8388..3b332075fcc 100644
--- a/src/man/libpq.3
+++ b/src/man/libpq.3
@@ -1,7 +1,7 @@
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
-.\" $Header: /cvsroot/pgsql/src/man/Attic/libpq.3,v 1.22 1998/07/15 17:34:06 momjian Exp $
-.TH LIBPQ INTRO 07/08/98 PostgreSQL PostgreSQL
+.\" $Header: /cvsroot/pgsql/src/man/Attic/libpq.3,v 1.23 1998/08/09 02:59:33 momjian Exp $
+.TH LIBPQ INTRO 08/08/98 PostgreSQL PostgreSQL
.SH DESCRIPTION
Libpq is the programmer's interface to Postgres. Libpq is a set of
library routines which allows
@@ -823,6 +823,36 @@ Disable tracing started by
.nf
void PQuntrace(PGconn *conn)
.fi
+
+.PP
+.SH "LIBPQ Control Functions"
+.PP
+.B PQsetNoticeProcessor
+.IP
+Control reporting of notice and warning messages generated by libpq.
+.nf
+void PQsetNoticeProcessor (PGconn * conn,
+ void (*noticeProcessor) (void * arg, const char * message),
+ void * arg)
+.fi
+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
+.nf
+static void
+defaultNoticeProcessor(void * arg, const char * message)
+{
+ fprintf(stderr, "%s", message);
+}
+.fi
+To use a special notice processor, call PQsetNoticeProcessor just after
+any creation of a new PGconn object.
+
.PP
.SH "User Authentication Functions"
.PP