diff options
author | Robert Haas <rhaas@postgresql.org> | 2013-12-10 19:17:34 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2013-12-10 19:17:34 -0500 |
commit | 66abc2608c7c00fcd449e00a9e23f13f02e65d04 (patch) | |
tree | a8c2e194383d6313752c5540888f3c2e5bd98f02 /src/backend/commands/tablecmds.c | |
parent | e55704d8b2fe522fbc9435acbb5bc59033478bd5 (diff) | |
download | postgresql-66abc2608c7c00fcd449e00a9e23f13f02e65d04.tar.gz postgresql-66abc2608c7c00fcd449e00a9e23f13f02e65d04.zip |
Add a new reloption, user_catalog_table.
When this reloption is set and wal_level=logical is configured,
we'll record the CIDs stamped by inserts, updates, and deletes to
the table just as we would for an actual catalog table. This will
allow logical decoding to use historical MVCC snapshots to access
such tables just as they access ordinary catalog tables.
Replication solutions built around the logical decoding machinery
will likely need to set this operation for their configuration
tables; it might also be needed by extensions which perform table
access in their output functions.
Andres Freund, reviewed by myself and others.
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r-- | src/backend/commands/tablecmds.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 1d9f29a7b7c..b9cd88d5701 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -3532,6 +3532,12 @@ ATRewriteTables(List **wqueue, LOCKMODE lockmode) errmsg("cannot rewrite system relation \"%s\"", RelationGetRelationName(OldHeap)))); + if (RelationIsUsedAsCatalogTable(OldHeap)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot rewrite table \"%s\" used as a catalog table", + RelationGetRelationName(OldHeap)))); + /* * Don't allow rewrite on temp tables of other backends ... their * local buffer manager is not going to cope. |