ALTER PUBLICATION

用于修改发布的 SQL 命令

ALTER PUBLICATION 是一个用于修改 发布 的 DDL 命令。

ALTER PUBLICATIONPostgreSQL 10 中被添加。

变更历史

示例

ALTER PUBLICATION 的示例用法

postgres=# ALTER PUBLICATION test_publication RENAME TO foo;
ALTER PUBLICATION

向现有发布添加表

postgres=# ALTER PUBLICATION misc_publication ADD TABLE bar;
ALTER PUBLICATION

无法向被定义为 "FOR ALL TABLES" 的发布添加或从中删除表。

postgres=# ALTER PUBLICATION test_publication ADD TABLE bar;
ERROR:  publication "test_publication" is defined as FOR ALL TABLES
DETAIL:  Tables cannot be added to or dropped from FOR ALL TABLES publications.

postgres=# ALTER PUBLICATION test_publication DROP TABLE foo;
ERROR:  publication "test_publication" is defined as FOR ALL TABLES
DETAIL:  Tables cannot be added to or dropped from FOR ALL TABLES publications.

尝试修改不存在的发布

postgres=# ALTER PUBLICATION foo RENAME TO bar;
ERROR:  publication "foo" does not exist

分类

DDL, 逻辑复制, SQL 命令

另请参阅

CREATE PUBLICATION, DROP PUBLICATION, pg_publication, pg_publication_rel

反馈

提交对 "ALTER PUBLICATION" 的任何评论、建议或更正 在此处