|
8 | 8 | * Darko Prenosil <Darko.Prenosil@finteh.hr>
|
9 | 9 | * Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
|
10 | 10 | *
|
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 $ |
12 | 12 | * Copyright (c) 2001-2009, PostgreSQL Global Development Group
|
13 | 13 | * ALL RIGHTS RESERVED;
|
14 | 14 | *
|
|
48 | 48 | #include"executor/spi.h"
|
49 | 49 | #include"foreign/foreign.h"
|
50 | 50 | #include"lib/stringinfo.h"
|
| 51 | +#include"mb/pg_wchar.h" |
51 | 52 | #include"miscadmin.h"
|
52 | 53 | #include"nodes/execnodes.h"
|
53 | 54 | #include"nodes/nodes.h"
|
@@ -185,6 +186,7 @@ typedef struct remoteConnHashEnt
|
185 | 186 | errdetail("%s", msg))); \
|
186 | 187 | } \
|
187 | 188 | dblink_security_check(conn, rconn); \
|
| 189 | +PQsetClientEncoding(conn, GetDatabaseEncodingName()); \ |
188 | 190 | freeconn = true; \
|
189 | 191 | } \
|
190 | 192 | } while (0)
|
@@ -263,6 +265,9 @@ dblink_connect(PG_FUNCTION_ARGS)
|
263 | 265 | /* check password actually used if not superuser */
|
264 | 266 | dblink_security_check(conn,rconn);
|
265 | 267 |
|
| 268 | +/* attempt to set client encoding to match server encoding */ |
| 269 | +PQsetClientEncoding(conn,GetDatabaseEncodingName()); |
| 270 | + |
266 | 271 | if (connname)
|
267 | 272 | {
|
268 | 273 | rconn->conn=conn;
|
|