File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 88 * Darko Prenosil <Darko.Prenosil@finteh.hr>
99 * Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
1010 *
11- * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.79 2009/06/06 21:27:56 joe Exp $
11+ * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.80 2009/06/09 16:35:36 joe Exp $
1212 * Copyright (c) 2001-2009, PostgreSQL Global Development Group
1313 * ALL RIGHTS RESERVED;
1414 *
4848#include "executor/spi.h"
4949#include "foreign/foreign.h"
5050#include "lib/stringinfo.h"
51+ #include "mb/pg_wchar.h"
5152#include "miscadmin.h"
5253#include "nodes/execnodes.h"
5354#include "nodes/nodes.h"
@@ -185,6 +186,7 @@ typedef struct remoteConnHashEnt
185186 errdetail("%s", msg))); \
186187 } \
187188 dblink_security_check(conn, rconn); \
189+ PQsetClientEncoding(conn, GetDatabaseEncodingName()); \
188190 freeconn = true; \
189191 } \
190192 } while (0)
@@ -263,6 +265,9 @@ dblink_connect(PG_FUNCTION_ARGS)
263265 /* check password actually used if not superuser */
264266 dblink_security_check (conn , rconn );
265267
268+ /* attempt to set client encoding to match server encoding */
269+ PQsetClientEncoding (conn , GetDatabaseEncodingName ());
270+
266271 if (connname )
267272 {
268273 rconn -> conn = conn ;
You can’t perform that action at this time.
0 commit comments