Hi,
I'm working on a C application that is suppose to talk to PostgreSQL. Right now I need to handle notices and warnings sent by the server but I'm at a loss on how to make it work.
The (very unclear) documentation says we should use PQsetNoticeReceiver to set a method as the receiver of notifications, as the default receiver just forwards the notification to PQnoticeProcessor and this prints to stderr.
I've defined a method thus
static void noticeReceiver(void *arg, const PGresult *res)
and I'm setting it as the default notice receiver on startup thus
PQsetNoticeReceiver(conn, noticeReceiver, NULL);
In my method implementation I'm simply printing some random characters to screen but it doesn't get called. Step by step debugging shows that its being set as the default notice receiver but its never called.
Any ideas?