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

Commitc3368f9

Browse files
committed
Fix logical replication with different encodings
reported by Shinoda, Noriyoshi <noriyoshi.shinoda@hpe.com>; partialpatch by Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
1 parente8d016d commitc3368f9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

‎src/backend/replication/libpqwalreceiver/libpqwalreceiver.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include"libpq-fe.h"
2323
#include"pqexpbuffer.h"
2424
#include"access/xlog.h"
25+
#include"mb/pg_wchar.h"
2526
#include"miscadmin.h"
2627
#include"pgstat.h"
2728
#include"replication/logicalproto.h"
@@ -134,9 +135,16 @@ libpqrcv_connect(const char *conninfo, bool logical, const char *appname,
134135
}
135136
keys[++i]="fallback_application_name";
136137
vals[i]=appname;
138+
if (logical)
139+
{
140+
keys[++i]="client_encoding";
141+
vals[i]=GetDatabaseEncodingName();
142+
}
137143
keys[++i]=NULL;
138144
vals[i]=NULL;
139145

146+
Assert(i<sizeof(keys));
147+
140148
conn=palloc0(sizeof(WalReceiverConn));
141149
conn->streamConn=PQconnectdbParams(keys,vals,/* expand_dbname = */ true);
142150
if (PQstatus(conn->streamConn)!=CONNECTION_OK)

‎src/backend/replication/logical/proto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple)
444444
outputstr=OidOutputFunctionCall(typclass->typoutput,values[i]);
445445
len=strlen(outputstr)+1;/* null terminated */
446446
pq_sendint(out,len,4);/* length */
447-
appendBinaryStringInfo(out,outputstr,len);/* data */
447+
pq_sendstring(out,outputstr);/* data */
448448

449449
pfree(outputstr);
450450

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp