Skip to content

Commit df82d45

Browse files
author
Antonin Houska
committed
Adopt recent addition of Assert() to PG core.
1 parent fd514c8 commit df82d45

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pg_rewrite.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,15 @@ rewrite_table_impl(char *relschema_src, char *relname_src,
979979
*/
980980
snap_hist = build_historic_snapshot(ctx->snapshot_builder);
981981

982+
/*
983+
* Cope with commit 706054b11b in PG core.
984+
*
985+
* If we did this earlier, earlier SnapBuildInitialSnapshot() would raise
986+
* ERROR. We shouldn't have called heap_insert|update|delete by now
987+
* anyway.
988+
*/
989+
PushActiveSnapshot(GetTransactionSnapshot());
990+
982991
/*
983992
* Create a conversion map so that we can handle difference(s) in the
984993
* tuple descriptor. Note that a copy is passed to 'indesc' since the map
@@ -1251,6 +1260,9 @@ rewrite_table_impl(char *relschema_src, char *relname_src,
12511260
FreeExecutorState(estate);
12521261
if (conv_map)
12531262
free_conversion_map_ext(conv_map);
1263+
1264+
/* See the top of the function. */
1265+
PopActiveSnapshot();
12541266
}
12551267

12561268
/*

0 commit comments

Comments
 (0)