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 命令

另请参见

CREATE PUBLICATIONDROP PUBLICATIONpg_publicationpg_publication_rel

反馈

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