diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 30285bd..0803e0a 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -1377,11 +1377,7 @@ RecordTransactionCommit(void) * DELETE ROWS invals, but we've not done the work to withhold them. */ if (nmsgs != 0) - { - LogStandbyInvalidations(nmsgs, invalMessages, - RelcacheInitFileInval); - wrote_xlog = true; /* not strictly necessary */ - } + elog(ERROR, "cannot commit a transaction with invalidation messages but no xid"); /* * If we didn't create XLOG entries, we're done here; otherwise we diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 7fa80a5..3ef5b15 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -17439,6 +17439,10 @@ PreCommit_on_commit_actions(void) List *oids_to_truncate = NIL; List *oids_to_drop = NIL; + /* If no XID, we didn't create material to truncate or drop. */ + if (!TransactionIdIsValid(GetCurrentTransactionIdIfAny())) + return; + foreach(l, on_commits) { OnCommitItem *oc = (OnCommitItem *) lfirst(l); diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c index 2a1e713..d87cc85 100644 --- a/src/backend/commands/typecmds.c +++ b/src/backend/commands/typecmds.c @@ -2878,7 +2878,8 @@ AlterDomainDropConstraint(List *names, const char *constrName, * dependent plans get rebuilt. Since this command doesn't change the * domain's pg_type row, that won't happen automatically; do it manually. */ - CacheInvalidateHeapTuple(rel, tup, NULL); + if (found) + CacheInvalidateHeapTuple(rel, tup, NULL); ObjectAddressSet(address, TypeRelationId, domainoid);