Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a9e9f59

Browse files
author
Thomas G. Lockhart
committed
Update for new information on PQsetNoticeProcessor().
Now back in sync with libpq.3 man page, which should be obsolete soon.
1 parent c4bf0c0 commit a9e9f59

File tree

1 file changed

+46
-3
lines changed

1 file changed

+46
-3
lines changed

doc/src/sgml/libpq.sgml

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ sets the default cost for indexed searches for the optimizer.
129129
</Para>
130130

131131
<Para>
132-
See the set(l)
133-
man page for information on the arguments for these environment variables.
132+
Refer to the <command>SET</command> <acronym>SQL</acronym> command
133+
for information on the arguments for these environment variables.
134134

135135
</Sect1>
136136

@@ -1073,6 +1073,49 @@ void PQuntrace(PGconn *conn)
10731073

10741074
</Sect1>
10751075

1076+
<Sect1>
1077+
<Title>
1078+
<FileName>libpq</FileName> Control Functions</Title>
1079+
1080+
<Para>
1081+
<ItemizedList>
1082+
<ListItem>
1083+
<Para>
1084+
<Function>PQsetNoticeProcessor</Function>
1085+
Control reporting of notice and warning messages generated by libpq.
1086+
<ProgramListing>
1087+
void PQsetNoticeProcessor (PGconn * conn,
1088+
void (*noticeProcessor) (void * arg, const char * message),
1089+
void * arg)
1090+
</ProgramListing>
1091+
</Para>
1092+
</ListItem>
1093+
</ItemizedList>
1094+
</Para>
1095+
1096+
<Para>
1097+
By default, <filename>libpq</filename> prints "notice" messages from the backend on stderr,
1098+
as well as a few error messages that it generates by itself.
1099+
This behavior can be overridden by supplying a callback function that
1100+
does something else with the messages. The callback function is passed
1101+
the text of the error message (which includes a trailing newline), plus
1102+
a void pointer that is the same one passed to <function>PQsetNoticeProcessor</function>.
1103+
(This pointer can be used to access application-specific state if needed.)
1104+
The default notice processor is simply
1105+
<ProgramListing>
1106+
static void
1107+
defaultNoticeProcessor(void * arg, const char * message)
1108+
{
1109+
fprintf(stderr, "%s", message);
1110+
}
1111+
</ProgramListing>
1112+
1113+
<Para>
1114+
To use a special notice processor, call <function>PQsetNoticeProcessor</function> just after
1115+
any creation of a new PGconn object.
1116+
1117+
</Sect1>
1118+
10761119
<Sect1>
10771120
<Title>User Authentication Functions</Title>
10781121

@@ -1124,7 +1167,7 @@ void fe_setauthsvc(char *name,
11241167
</Sect1>
11251168

11261169
<Sect1>
1127-
<Title>BUGS</Title>
1170+
<Title>Caveats</Title>
11281171

11291172
<Para>
11301173
The query buffer is 8192 bytes long, and queries over

0 commit comments

Comments
 (0)