diff options
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/publicationcmds.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c index 8f324298b59..13b41e6b415 100644 --- a/src/backend/commands/publicationcmds.c +++ b/src/backend/commands/publicationcmds.c @@ -215,6 +215,11 @@ CreatePublication(CreatePublicationStmt *stmt) PublicationAddTables(puboid, rels, true, NULL); CloseTableList(rels); } + else if (stmt->for_all_tables) + { + /* Invalidate relcache so that publication info is rebuilt. */ + CacheInvalidateRelcacheAll(); + } heap_close(rel, RowExclusiveLock); @@ -424,6 +429,7 @@ RemovePublicationById(Oid pubid) { Relation rel; HeapTuple tup; + Form_pg_publication pubform; rel = heap_open(PublicationRelationId, RowExclusiveLock); @@ -432,6 +438,12 @@ RemovePublicationById(Oid pubid) if (!HeapTupleIsValid(tup)) elog(ERROR, "cache lookup failed for publication %u", pubid); + pubform = (Form_pg_publication) GETSTRUCT(tup); + + /* Invalidate relcache so that publication info is rebuilt. */ + if (pubform->puballtables) + CacheInvalidateRelcacheAll(); + CatalogTupleDelete(rel, &tup->t_self); ReleaseSysCache(tup); |