mirror of
https://github.com/postgres/postgres.git
synced 2025-05-08 07:21:33 +03:00
Get a snapshot before COPY in table sync
This fixes a crash if the local table has a function index and the function makes non-immutable calls. Reported-by: Scott Milliken <scott@deltaex.com> Author: Masahiko Sawada <sawada.mshk@gmail.com>
This commit is contained in:
parent
f352f91cbf
commit
cf65201833
@ -917,7 +917,9 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
|
|||||||
walrcv_create_slot(wrconn, slotname, true,
|
walrcv_create_slot(wrconn, slotname, true,
|
||||||
CRS_USE_SNAPSHOT, origin_startpos);
|
CRS_USE_SNAPSHOT, origin_startpos);
|
||||||
|
|
||||||
|
PushActiveSnapshot(GetTransactionSnapshot());
|
||||||
copy_table(rel);
|
copy_table(rel);
|
||||||
|
PopActiveSnapshot();
|
||||||
|
|
||||||
res = walrcv_exec(wrconn, "COMMIT", 0, NULL);
|
res = walrcv_exec(wrconn, "COMMIT", 0, NULL);
|
||||||
if (res->status != WALRCV_OK_COMMAND)
|
if (res->status != WALRCV_OK_COMMAND)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user