Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite5de601

Browse files
committed
Default client encoding to server encoding for dblink connections. Addresses
issue raised by Ruzsinszky Attila and confirmed by others. ----------------------------------------------------------------------
1 parentadaf601 commite5de601

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎contrib/dblink/dblink.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
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
*
@@ -48,6 +48,7 @@
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;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp