Skip to content

Commit df085fc

Browse files
committed
Force active snapshot obtaining during insert. Fixes #18
1 parent 10b1f04 commit df085fc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

contrib/mmts/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);

src/test/regress/serial_schedule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ test: triggers
7070
test: inherit
7171
test: create_table_like
7272
test: typed_table
73-
# test: vacuum # issue#18
73+
test: vacuum
7474
test: drop_if_exists
7575
test: updatable_views
7676
test: rolenames

0 commit comments

Comments
 (0)