Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 496a138

Browse files
committed
Force active snapshot obtaining during insert. Fixes postgres#18
1 parent 4818af6 commit 496a138

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pglogical_apply.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,8 @@ process_remote_insert(StringInfo s, Relation rel)
672672
ScanKey *index_keys;
673673
int i;
674674

675+
PushActiveSnapshot(GetTransactionSnapshot());
676+
675677
estate = create_rel_estate(rel);
676678
newslot = ExecInitExtraTupleSlot(estate);
677679
oldslot = ExecInitExtraTupleSlot(estate);
@@ -747,6 +749,9 @@ process_remote_insert(StringInfo s, Relation rel)
747749

748750
ExecCloseIndices(estate->es_result_relation_info);
749751

752+
if (ActiveSnapshotSet())
753+
PopActiveSnapshot();
754+
750755
heap_close(rel, NoLock);
751756
ExecResetTupleTable(estate->es_tupleTable, true);
752757
FreeExecutorState(estate);

0 commit comments

Comments
 (0)