Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/pgactive_ddlrep_truncate.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,13 @@ pgactive_queue_truncate(PG_FUNCTION_ARGS)
if (replorigin_session_origin != InvalidRepOriginId)
PG_RETURN_VOID(); /* XXX return type? */

/*
* If DDL replication is not enabled, we need to set
* pgactive_truncated_tables to NIL to avoid stale pointer.
*/
if (pgactive_skip_ddl_replication && pgactive_truncated_tables != NIL)
pgactive_truncated_tables = NIL;

/* Make sure the list change survives the trigger call. */
oldcontext = MemoryContextSwitchTo(TopTransactionContext);
pgactive_truncated_tables = lappend_oid(pgactive_truncated_tables,
Expand Down