mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Logical replication
- Add PUBLICATION catalogs and DDL - Add SUBSCRIPTION catalog and DDL - Define logical replication protocol and output plugin - Add logical replication workers From: Petr Jelinek <petr@2ndquadrant.com> Reviewed-by: Steve Singer <steve@ssinger.info> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Erik Rijkers <er@xs4all.nl> Reviewed-by: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
This commit is contained in:
@ -12055,6 +12055,18 @@ ATPrepChangePersistence(Relation rel, bool toLogged)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check that the table is not part any publication when changing to
|
||||
* UNLOGGED as UNLOGGED tables can't be published.
|
||||
*/
|
||||
if (!toLogged &&
|
||||
list_length(GetRelationPublications(RelationGetRelid(rel))) > 0)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("cannot change table \"%s\" to unlogged because it is part of a publication",
|
||||
RelationGetRelationName(rel)),
|
||||
errdetail("Unlogged relations cannot be replicated.")));
|
||||
|
||||
/*
|
||||
* Check existing foreign key constraints to preserve the invariant that
|
||||
* permanent tables cannot reference unlogged ones. Self-referencing
|
||||
|
Reference in New Issue
Block a user