-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.377 2006/07/14 14:32:08 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.378 2006/07/14 14:42:57 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
PH/20 Perl can change the locale. Exim was resetting it after a ${perl call,
but not after initializing Perl.
+PH/21 Added a call to PQsetNoticeProcessor() to catch pgsql "notices" and
+ output them only if debugging. By default they are written stderr,
+ apparently, which is not desirable.
+
Exim version 4.62
-----------------
-/* $Cambridge: exim/src/src/lookups/pgsql.c,v 1.6 2006/07/14 14:21:27 ph10 Exp $ */
+/* $Cambridge: exim/src/src/lookups/pgsql.c,v 1.7 2006/07/14 14:42:57 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
}
+/*************************************************
+* Notice processor function for pgsql *
+*************************************************/
+
+/* This function is passed to pgsql below, and called for any PostgreSQL
+"notices". By default they are written to stderr, which is undesirable.
+
+Arguments:
+ arg an opaque user cookie (not used)
+ message the notice
+
+Returns: nothing
+*/
+
+static void
+notice_processor(void *arg, const char *message)
+{
+arg = arg; /* Keep compiler happy */
+DEBUG(D_lookup) debug_printf("PGSQL: %s\n", message);
+}
+
+
/*************************************************
* Internal search function *
PQsetClientEncoding(pg_conn, "SQL_ASCII");
+ /* Set the notice processor to prevent notices from being written to stderr
+ (which is what the default does). Our function (above) just produces debug
+ output. */
+
+ PQsetNoticeProcessor(pg_conn, notice_processor, NULL);
+
/* Add the connection to the cache */
cn = store_get(sizeof(pgsql_connection));