Added extra information about errors to the PostgreSQL error string.
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Tue, 13 Sep 2005 11:27:45 +0000 (11:27 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Tue, 13 Sep 2005 11:27:45 +0000 (11:27 +0000)
doc/doc-txt/ChangeLog
src/src/lookups/pgsql.c

index 6444b330e63aacdec86a93176f091c62cd733aab..1338d3d63ea37dd53d89b08d4b6caa05b7440741 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.227 2005/09/13 11:13:27 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.228 2005/09/13 11:27:45 ph10 Exp $
 
 Change log file for Exim from version 4.21
 -------------------------------------------
@@ -181,6 +181,8 @@ TF/01 Add missing LIBS=-lm to OS/Makefile-OpenBSD which was overlooked when
 
 PH/45 Added $smtp_command for the full command (cf $smtp_command_argument).
 
+PH/46 Added extra information about PostgreSQL errors to the error string.
+
 
 Exim version 4.52
 -----------------
index 731790fd2c8456abf7b64d12822a7f7322c630e0..a4f396d741b3ba44e96cad6fedd4089a60087f76 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/lookups/pgsql.c,v 1.2 2005/01/04 10:00:44 ph10 Exp $ */
+/* $Cambridge: exim/src/src/lookups/pgsql.c,v 1.3 2005/09/13 11:27:45 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -285,8 +285,15 @@ else
     break;
 
     default:
+    /* This was the original code:
     *errmsg = string_sprintf("PGSQL: query failed: %s\n",
                              PQresultErrorMessage(pg_result));
+    This was suggested by a user:
+    */
+
+    *errmsg = string_sprintf("PGSQL: query failed: %s (%s) (%s)\n",
+                             PQresultErrorMessage(pg_result),
+                             PQresStatus(PQresultStatus(pg_result)), query);
     *defer_break = FALSE;
     goto PGSQL_EXIT;
     }