summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2006-07-14 14:21:27 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2006-07-14 14:21:27 +0000
commit16282d2b161d7a169cdbcafaea7222233ba3dab8 (patch)
tree905d9fad634a73b8d1ddd3b9c610bb7deeb50831 /src
parent34fab493f633baf3f0013f0d07cdc64fc93c19f4 (diff)
Add PQsetClientEncoding(conn, "SQL_ASCII") to the pgsql module.
Diffstat (limited to 'src')
-rw-r--r--src/src/lookups/pgsql.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/src/lookups/pgsql.c b/src/src/lookups/pgsql.c
index caefeef18..8b777f40b 100644
--- a/src/src/lookups/pgsql.c
+++ b/src/src/lookups/pgsql.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/lookups/pgsql.c,v 1.5 2006/06/30 13:57:46 ph10 Exp $ */
+/* $Cambridge: exim/src/src/lookups/pgsql.c,v 1.6 2006/07/14 14:21:27 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -247,6 +247,12 @@ if (cn == NULL)
goto PGSQL_EXIT;
}
+ /* Set the client encoding to SQL_ASCII, which means that the server will
+ not try to interpret the query as being in any fancy encoding such as UTF-8
+ or other multibyte code that might cause problems with escaping. */
+
+ PQsetClientEncoding(pg_conn, "SQL_ASCII");
+
/* Add the connection to the cache */
cn = store_get(sizeof(pgsql_connection));