Skip to content

Commit cf65201

Browse files
committed
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>
1 parent f352f91 commit cf65201

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/backend/replication/logical/tablesync.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,9 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
917917
walrcv_create_slot(wrconn, slotname, true,
918918
CRS_USE_SNAPSHOT, origin_startpos);
919919

920+
PushActiveSnapshot(GetTransactionSnapshot());
920921
copy_table(rel);
922+
PopActiveSnapshot();
921923

922924
res = walrcv_exec(wrconn, "COMMIT", 0, NULL);
923925
if (res->status != WALRCV_OK_COMMAND)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy