ALTER PUBLICATION

用于修改发布的SQL命令

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

ALTER PUBLICATION 添加于PostgreSQL 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命令

另请参阅

创建发布删除发布pg_publicationpg_publication_rel

反馈

提交任何关于“ALTER PUBLICATION”的评论、建议或更正 此处