* Darko Prenosil <Darko.Prenosil@finteh.hr>
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
*
- * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.79 2009/06/06 21:27:56 joe Exp $
+ * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.80 2009/06/09 16:35:36 joe Exp $
* Copyright (c) 2001-2009, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED;
*
#include "executor/spi.h"
#include "foreign/foreign.h"
#include "lib/stringinfo.h"
+#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "nodes/execnodes.h"
#include "nodes/nodes.h"
errdetail("%s", msg))); \
} \
dblink_security_check(conn, rconn); \
+ PQsetClientEncoding(conn, GetDatabaseEncodingName()); \
freeconn = true; \
} \
} while (0)
/* check password actually used if not superuser */
dblink_security_check(conn, rconn);
+ /* attempt to set client encoding to match server encoding */
+ PQsetClientEncoding(conn, GetDatabaseEncodingName());
+
if (connname)
{
rconn->conn = conn;