{"Entry":{"collection":"sql","key":"alter-publication","name":"ALTER PUBLICATION","aliases":["alterpublication"],"metadata":{"aliases":["alterpublication"],"changed_in":["14","15","19"],"changes":[{"from":"9.6","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"added","synopsis":null,"to":"10"},{"from":"13","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"changed","synopsis":{"added":["ALTER PUBLICATION name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }"],"removed":[]},"to":"14"},{"from":"14","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["description","parameters","examples"],"removed":[]},"status":"changed","synopsis":{"added":["ALTER PUBLICATION name ADD publication_object [, ...]","ALTER PUBLICATION name SET publication_object [, ...]","ALTER PUBLICATION name DROP publication_drop_object [, ...]","TABLE table_and_columns [, ... ]","TABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ]","TABLE [ ONLY ] table_name [ * ] [, ... ]","TABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ]","[ ONLY ] table_name [ * ] [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ]"],"removed":["ALTER PUBLICATION name ADD TABLE [ ONLY ] table_name [ * ] [, ...]","ALTER PUBLICATION name SET TABLE [ ONLY ] table_name [ * ] [, ...]","ALTER PUBLICATION name DROP TABLE [ ONLY ] table_name [ * ] [, ...]"]},"to":"15"},{"from":"15","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["description"],"removed":[]},"status":"changed","synopsis":null,"to":"16"},{"from":"17","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"18"},{"from":"18","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["description","parameters","examples"],"removed":[]},"status":"changed","synopsis":{"added":["ALTER PUBLICATION name SET { publication_object [, ...] | publication_all_object [, ... ] }","ALL TABLES [ EXCEPT ( except_table_object [, ... ] ) ]","ALL SEQUENCES","TABLE table_object [, ... ]","table_object [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ]","TABLE table_object [, ... ]","[ ONLY ] table_name [ * ]"],"removed":["ALTER PUBLICATION name ADD publication_object [, ...]","ALTER PUBLICATION name SET publication_object [, ...]","TABLE [ ONLY ] table_name [ * ] [, ... ]","[ ONLY ] table_name [ * ] [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ]"]},"to":"19"},{"from":"19","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"20"}],"content_hash":"785baa296174a4aa95632030afa5a2f79903c3e29e363ce44060a9f1795ab2ad","editorial":{},"first_version":"10","group":"replication","imported_at":"2026-09-30T17:43:38.904215+08:00","last_version":"20","name":"ALTER PUBLICATION","object":"PUBLICATION","position":10001,"present_in":["10","11","12","13","14","15","16","17","18","19","20"],"purpose":"change the definition of a publication","purpose_zh":"","related":["create-publication","drop-publication","create-subscription","alter-subscription"],"slug":"alter-publication","source_rev":"a709ab85","synopsis":"ALTER PUBLICATION name ADD publication_object [, ...]\nALTER PUBLICATION name DROP publication_drop_object [, ...]\nALTER PUBLICATION name SET { publication_object [, ...] | publication_all_object [, ... ] }\nALTER PUBLICATION name SET ( publication_parameter [= value] [, ... ] )\nALTER PUBLICATION name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }\nALTER PUBLICATION name RENAME TO new_name\nwhere publication_object is one of:\n\nTABLE table_and_columns [, ... ]\nTABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ]\n\nand publication_all_object is one of:\n\nALL TABLES [ EXCEPT ( except_table_object [, ... ] ) ]\nALL SEQUENCES\n\nand publication_drop_object is one of:\n\nTABLE table_object [, ... ]\nTABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ]\n\nand table_and_columns is:\ntable_object [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ]\n\nand except_table_object is:\n\nTABLE table_object [, ... ]\n\nand table_object is:\n\n[ ONLY ] table_name [ * ]","verb":"ALTER"}},"Definition":{"Collection":"sql","Key":"alter-publication","SourceDatabase":"center","Version":"18","SourceTable":"sqlcmd","SourceKey":"alter-publication","SourceRevision":"a709ab85","Facts":{"anchor":"SQL-ALTERPUBLICATION","file":"sql-alterpublication.html","lang":"en","name":"ALTER PUBLICATION","purpose":"change the definition of a publication","purpose_zh":"","related":["create-publication","drop-publication","create-subscription","alter-subscription"],"sections":[{"html":"\u003cp\u003eThe command \u003ccode class=\"command\"\u003eALTER PUBLICATION\u003c/code\u003e can change the attributes of a publication.\u003c/p\u003e\u003cp\u003eThe first three variants change which tables/schemas are part of the publication. The \u003ccode class=\"literal\"\u003eSET\u003c/code\u003e clause will replace the list of tables/schemas in the publication with the specified list; the existing tables/schemas that were present in the publication will be removed. The \u003ccode class=\"literal\"\u003eADD\u003c/code\u003e and \u003ccode class=\"literal\"\u003eDROP\u003c/code\u003e clauses will add and remove one or more tables/schemas from the publication. Note that adding tables/schemas to a publication that is already subscribed to will require an \u003ca href=\"/docs/18/sql-altersubscription.html#SQL-ALTERSUBSCRIPTION-PARAMS-REFRESH-PUBLICATION\"\u003e\u003ccode class=\"literal\"\u003eALTER SUBSCRIPTION ... REFRESH PUBLICATION\u003c/code\u003e\u003c/a\u003e action on the subscribing side in order to become effective. Note also that \u003ccode class=\"literal\"\u003eDROP TABLES IN SCHEMA\u003c/code\u003e will not drop any schema tables that were specified using \u003ca href=\"/docs/18/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-TABLE\"\u003e\u003ccode class=\"literal\"\u003eFOR TABLE\u003c/code\u003e\u003c/a\u003e/ \u003ccode class=\"literal\"\u003eADD TABLE\u003c/code\u003e.\u003c/p\u003e\u003cp\u003eThe fourth variant of this command listed in the synopsis can change all of the publication properties specified in \u003ca href=\"/docs/18/sql-createpublication.html\" title=\"CREATE PUBLICATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE PUBLICATION\u003c/span\u003e\u003c/a\u003e. Properties not mentioned in the command retain their previous settings.\u003c/p\u003e\u003cp\u003eThe remaining variants change the owner and the name of the publication.\u003c/p\u003e\u003cp\u003eYou must own the publication to use \u003ccode class=\"command\"\u003eALTER PUBLICATION\u003c/code\u003e. Adding a table to a publication additionally requires owning that table. The \u003ccode class=\"literal\"\u003eADD TABLES IN SCHEMA\u003c/code\u003e and \u003ccode class=\"literal\"\u003eSET TABLES IN SCHEMA\u003c/code\u003e to a publication requires the invoking user to be a superuser. To alter the owner, you must be able to \u003ccode class=\"literal\"\u003eSET ROLE\u003c/code\u003e to the new owning role, and that role must have \u003ccode class=\"literal\"\u003eCREATE\u003c/code\u003e privilege on the database. Also, the new owner of a \u003ca href=\"/docs/18/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-ALL-TABLES\"\u003e\u003ccode class=\"literal\"\u003eFOR ALL TABLES\u003c/code\u003e\u003c/a\u003e or \u003ca href=\"/docs/18/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-TABLES-IN-SCHEMA\"\u003e\u003ccode class=\"literal\"\u003eFOR TABLES IN SCHEMA\u003c/code\u003e\u003c/a\u003e publication must be a superuser. However, a superuser can change the ownership of a publication regardless of these restrictions.\u003c/p\u003e\u003cp\u003eAdding/Setting any schema when the publication also publishes a table with a column list, and vice versa is not supported.\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of an existing publication whose definition is to be altered.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eName of an existing table. If \u003ccode class=\"literal\"\u003eONLY\u003c/code\u003e is specified before the table name, only that table is affected. If \u003ccode class=\"literal\"\u003eONLY\u003c/code\u003e is not specified, the table and all its descendant tables (if any) are affected. Optionally, \u003ccode class=\"literal\"\u003e*\u003c/code\u003e can be specified after the table name to explicitly indicate that descendant tables are included.\u003c/p\u003e\u003cp\u003eOptionally, a column list can be specified. See \u003ca href=\"/docs/18/sql-createpublication.html\" title=\"CREATE PUBLICATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE PUBLICATION\u003c/span\u003e\u003c/a\u003e for details. Note that a subscription having several publications in which the same table has been published with different column lists is not supported. See \u003ca href=\"/docs/18/logical-replication-col-lists.html#LOGICAL-REPLICATION-COL-LIST-COMBINING\" title=\"Warning: Combining Column Lists from Multiple Publications\"\u003eWarning: Combining Column Lists from Multiple Publications\u003c/a\u003e for details of potential problems when altering column lists.\u003c/p\u003e\u003cp\u003eIf the optional \u003ccode class=\"literal\"\u003eWHERE\u003c/code\u003e clause is specified, rows for which the \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e evaluates to false or null will not be published. Note that parentheses are required around the expression. The \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e is evaluated with the role used for the replication connection.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eName of an existing schema.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eSET ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_parameter\u003c/code\u003e\u003c/em\u003e [= \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e] [, ... ] )\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThis clause alters publication parameters originally set by \u003ca href=\"/docs/18/sql-createpublication.html\" title=\"CREATE PUBLICATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE PUBLICATION\u003c/span\u003e\u003c/a\u003e. See there for more information.\u003c/p\u003e\u003cdiv class=\"caution\"\u003e\u003ch3\u003eCaution\u003c/h3\u003e\u003cp\u003eAltering the \u003ccode class=\"literal\"\u003epublish_via_partition_root\u003c/code\u003e parameter can lead to data loss or duplication at the subscriber because it changes the identity and schema of the published tables. Note this happens only when a partition root table is specified as the replication target.\u003c/p\u003e\u003cp\u003eThis problem can be avoided by refraining from modifying partition leaf tables after the \u003ccode class=\"command\"\u003eALTER PUBLICATION ... SET\u003c/code\u003e until the \u003ca href=\"/docs/18/sql-altersubscription.html\" title=\"ALTER SUBSCRIPTION\"\u003e\u003ccode class=\"command\"\u003eALTER SUBSCRIPTION ... REFRESH PUBLICATION\u003c/code\u003e\u003c/a\u003e is executed and by only refreshing using the \u003ccode class=\"literal\"\u003ecopy_data = off\u003c/code\u003e option.\u003c/p\u003e\u003c/div\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_owner\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe user name of the new owner of the publication.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe new name for the publication.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003eChange the publication to publish only deletes and updates:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER PUBLICATION noinsert SET (publish = 'update, delete');\n\u003c/pre\u003e\u003cp\u003eAdd some tables to the publication:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER PUBLICATION mypublication ADD TABLE users (user_id, firstname), departments;\n\u003c/pre\u003e\u003cp\u003eChange the set of columns published for a table:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER PUBLICATION mypublication SET TABLE users (user_id, firstname, lastname), TABLE departments;\n\u003c/pre\u003e\u003cp\u003eAdd schemas \u003ccode class=\"structname\"\u003emarketing\u003c/code\u003e and \u003ccode class=\"structname\"\u003esales\u003c/code\u003e to the publication \u003ccode class=\"structname\"\u003esales_publication\u003c/code\u003e:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER PUBLICATION sales_publication ADD TABLES IN SCHEMA marketing, sales;\n\u003c/pre\u003e\u003cp\u003eAdd tables \u003ccode class=\"structname\"\u003eusers\u003c/code\u003e, \u003ccode class=\"structname\"\u003edepartments\u003c/code\u003e and schema \u003ccode class=\"structname\"\u003eproduction\u003c/code\u003e to the publication \u003ccode class=\"structname\"\u003eproduction_publication\u003c/code\u003e:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER PUBLICATION production_publication ADD TABLE users, departments, TABLES IN SCHEMA production;\n\u003c/pre\u003e","key":"examples","title":"Examples"},{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eALTER PUBLICATION\u003c/code\u003e is a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e extension.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/create-publication/?v=18\" title=\"CREATE PUBLICATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE PUBLICATION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-publication/?v=18\" title=\"DROP PUBLICATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eDROP PUBLICATION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-subscription/?v=18\" title=\"CREATE SUBSCRIPTION\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE SUBSCRIPTION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/alter-subscription/?v=18\" title=\"ALTER SUBSCRIPTION\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER SUBSCRIPTION\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","slug":"18","synopsis_html":"ALTER PUBLICATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e ADD \u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_object\u003c/code\u003e\u003c/em\u003e [, ...]\nALTER PUBLICATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e SET \u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_object\u003c/code\u003e\u003c/em\u003e [, ...]\nALTER PUBLICATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e DROP \u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_drop_object\u003c/code\u003e\u003c/em\u003e [, ...]\nALTER PUBLICATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e SET ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_parameter\u003c/code\u003e\u003c/em\u003e [= \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e] [, ... ] )\nALTER PUBLICATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e OWNER TO { \u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_owner\u003c/code\u003e\u003c/em\u003e | CURRENT_ROLE | CURRENT_USER | SESSION_USER }\nALTER PUBLICATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e RENAME TO \u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_name\u003c/code\u003e\u003c/em\u003e\n\n\u003cspan class=\"phrase\"\u003ewhere \u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_object\u003c/code\u003e\u003c/em\u003e is one of:\u003c/span\u003e\n\n    TABLE \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_and_columns\u003c/code\u003e\u003c/em\u003e [, ... ]\n    TABLES IN SCHEMA { \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema_name\u003c/code\u003e\u003c/em\u003e | CURRENT_SCHEMA } [, ... ]\n\n\u003cspan class=\"phrase\"\u003eand \u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_drop_object\u003c/code\u003e\u003c/em\u003e is one of:\u003c/span\u003e\n\n    TABLE [ ONLY ] \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_name\u003c/code\u003e\u003c/em\u003e [ * ] [, ... ]\n    TABLES IN SCHEMA { \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema_name\u003c/code\u003e\u003c/em\u003e | CURRENT_SCHEMA } [, ... ]\n\n\u003cspan class=\"phrase\"\u003eand \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_and_columns\u003c/code\u003e\u003c/em\u003e is:\u003c/span\u003e\n\n    [ ONLY ] \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_name\u003c/code\u003e\u003c/em\u003e [ * ] [ ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003ecolumn_name\u003c/code\u003e\u003c/em\u003e [, ... ] ) ] [ WHERE ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e ) ]","synopsis_text":"ALTER PUBLICATION name ADD publication_object [, ...]\nALTER PUBLICATION name SET publication_object [, ...]\nALTER PUBLICATION name DROP publication_drop_object [, ...]\nALTER PUBLICATION name SET ( publication_parameter [= value] [, ... ] )\nALTER PUBLICATION name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }\nALTER PUBLICATION name RENAME TO new_name\nwhere publication_object is one of:\n\nTABLE table_and_columns [, ... ]\nTABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ]\n\nand publication_drop_object is one of:\n\nTABLE [ ONLY ] table_name [ * ] [, ... ]\nTABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ]\n\nand table_and_columns is:\n\n[ ONLY ] table_name [ * ] [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ]"},"ManualEvidence":{},"MeasuredEvidence":{}},"Text":{"Collection":"sql","Key":"alter-publication","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"ALTER PUBLICATION","Summary":"修改发布的定义","BodyHTML":"\u003cpre\u003eALTER PUBLICATION name ADD publication_object [, ...]\nALTER PUBLICATION name SET publication_object [, ...]\nALTER PUBLICATION name DROP publication_drop_object [, ...]\nALTER PUBLICATION name SET ( publication_parameter [= value] [, ... ] )\nALTER PUBLICATION name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }\nALTER PUBLICATION name RENAME TO new_name\n其中publication_object可以是：\n\nTABLE table_and_columns [, ... ]\nTABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ]\n\n其中publication_drop_object可以是：\n\nTABLE [ ONLY ] table_name [ * ] [, ... ]\nTABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ]\n\n其中table_and_columns是：\n\n[ ONLY ] table_name [ * ] [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ]\u003c/pre\u003e\u003csection\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eALTER PUBLICATION\u003c/code\u003e命令可更改发布的属性。\u003c/p\u003e\u003cp\u003e前三种形式会更改哪些表或模式属于该发布。\u003ccode\u003eSET\u003c/code\u003e子句会用指定列表替换发布中的表或模式列表；原先已在该发布中的表或模式将被移除。\u003ccode\u003eADD\u003c/code\u003e和\u003ccode\u003eDROP\u003c/code\u003e子句则会向发布中添加或移除一个或多个表或模式。请注意，向已经被订阅的发布中添加表或模式后，需要在订阅端执行 \u003ca href=\"/docs/18/sql-altersubscription.html#SQL-ALTERSUBSCRIPTION-PARAMS-REFRESH-PUBLICATION\" rel=\"nofollow\"\u003e\u003ccode\u003eALTER SUBSCRIPTION ... REFRESH PUBLICATION\u003c/code\u003e\u003c/a\u003e 操作后才会生效。还要注意，\u003ccode\u003eDROP TABLES IN SCHEMA\u003c/code\u003e 不会移除那些位于模式中、但通过 \u003ca href=\"/docs/18/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-TABLE\" rel=\"nofollow\"\u003e\u003ccode\u003eFOR TABLE\u003c/code\u003e\u003c/a\u003e/\u003ccode\u003eADD TABLE\u003c/code\u003e 单独指定的表。\u003c/p\u003e\u003cp\u003e提要中列出的第四种形式可更改\u003ca href=\"/docs/18/sql-createpublication.html\" title=\"CREATE PUBLICATION\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE PUBLICATION\u003c/span\u003e\u003c/a\u003e中指定的所有发布属性。命令中未提及的属性会保留其先前的设置。\u003c/p\u003e\u003cp\u003e其余几种形式用于更改发布的所有者和名称。\u003c/p\u003e\u003cp\u003e要使用\u003ccode\u003eALTER PUBLICATION\u003c/code\u003e，你必须拥有该发布。向发布中添加表还要求拥有该表。对发布执行 \u003ccode\u003eADD TABLES IN SCHEMA\u003c/code\u003e和 \u003ccode\u003eSET TABLES IN SCHEMA\u003c/code\u003e要求调用用户为超级用户。要更改所有者，你必须能够对新的拥有角色执行\u003ccode\u003eSET ROLE\u003c/code\u003e，并且该角色必须在数据库上具有\u003ccode\u003eCREATE\u003c/code\u003e权限。此外，\u003ca href=\"/docs/18/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-ALL-TABLES\" rel=\"nofollow\"\u003e\u003ccode\u003eFOR ALL TABLES\u003c/code\u003e\u003c/a\u003e 或\u003ca href=\"/docs/18/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-TABLES-IN-SCHEMA\" rel=\"nofollow\"\u003e\u003ccode\u003eFOR TABLES IN SCHEMA\u003c/code\u003e\u003c/a\u003e 发布的新所有者也必须是超级用户。不过，超级用户可以不受这些限制而更改发布的所有权。\u003c/p\u003e\u003cp\u003e如果某个发布还发布了带列列表的表，则不支持向其中添加或设置任何模式；反之亦然。\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e参数\u003c/h2\u003e\u003cdiv\u003e\u003cdl\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e要更改其定义的现有发布名称。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003etable_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e现有表的名称。如果在表名前指定了\u003ccode\u003eONLY\u003c/code\u003e，则只有该表受影响。如果未指定\u003ccode\u003eONLY\u003c/code\u003e，则该表及其所有后代表（如果有）都会受影响。还可以在表名后指定\u003ccode\u003e*\u003c/code\u003e，以显式指明包含后代表。\u003c/p\u003e\u003cp\u003e还可以指定列列表。详见\u003ca href=\"/docs/18/sql-createpublication.html\" title=\"CREATE PUBLICATION\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE PUBLICATION\u003c/span\u003e\u003c/a\u003e。请注意，不支持这样的订阅：它包含多个发布，并且同一张表在这些发布中使用不同的列列表发布。有关更改列列表时可能出现的问题，详见\u003ca href=\"/docs/18/logical-replication-col-lists.html#LOGICAL-REPLICATION-COL-LIST-COMBINING\" rel=\"nofollow\"\u003e警告：组合来自多个发布的列列表\u003c/a\u003e。\u003c/p\u003e\u003cp\u003e如果指定了可选的\u003ccode\u003eWHERE\u003c/code\u003e子句，则 \u003cem\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e计算结果为 false 或 null 的行不会被发布。请注意，表达式外围必须有括号。\u003cem\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e会使用复制连接所用的角色来求值。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003eschema_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e现有模式的名称。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eSET ( \u003cem\u003e\u003ccode\u003epublication_parameter\u003c/code\u003e\u003c/em\u003e [= \u003cem\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e] [, ... ] )\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e该子句用于更改最初由\u003ca href=\"/docs/18/sql-createpublication.html\" title=\"CREATE PUBLICATION\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE PUBLICATION\u003c/span\u003e\u003c/a\u003e设置的发布参数。详见该命令的说明。\u003c/p\u003e\u003cdiv\u003e\u003ch3\u003e小心\u003c/h3\u003e\u003cp\u003e更改 \u003ccode\u003epublish_via_partition_root\u003c/code\u003e 参数可能导致订阅端发生数据丢失或重复，因为它会改变已发布表的标识和模式。请注意，只有当根分区表被指定为复制目标时，才会发生此问题。\u003c/p\u003e\u003cp\u003e可通过以下方式避免此问题：在执行 \u003ccode\u003eALTER PUBLICATION ... SET\u003c/code\u003e之后、执行 \u003ca href=\"/docs/18/sql-altersubscription.html\" title=\"ALTER SUBSCRIPTION\" rel=\"nofollow\"\u003e\u003ccode\u003eALTER SUBSCRIPTION ... REFRESH PUBLICATION\u003c/code\u003e\u003c/a\u003e 之前，不修改分区叶子表；并且刷新时仅使用 \u003ccode\u003ecopy_data = off\u003c/code\u003e选项。\u003c/p\u003e\u003c/div\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003enew_owner\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e发布的新所有者的用户名。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003enew_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e发布的新名称。\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e示例\u003c/h2\u003e\u003cp\u003e将发布修改为只发布删除和更新：\u003c/p\u003e\u003cpre\u003eALTER PUBLICATION noinsert SET (publish = \u0026#39;update, delete\u0026#39;);\n\u003c/pre\u003e\u003cp\u003e向发布中添加一些表：\u003c/p\u003e\u003cpre\u003eALTER PUBLICATION mypublication ADD TABLE users (user_id, firstname), departments;\n\u003c/pre\u003e\u003cp\u003e更改某个表所发布的列集合：\u003c/p\u003e\u003cpre\u003eALTER PUBLICATION mypublication SET TABLE users (user_id, firstname, lastname), TABLE departments;\n\u003c/pre\u003e\u003cp\u003e将模式\u003ccode\u003emarketing\u003c/code\u003e和\u003ccode\u003esales\u003c/code\u003e 添加到发布\u003ccode\u003esales_publication\u003c/code\u003e中：\u003c/p\u003e\u003cpre\u003eALTER PUBLICATION sales_publication ADD TABLES IN SCHEMA marketing, sales;\n\u003c/pre\u003e\u003cp\u003e将表\u003ccode\u003eusers\u003c/code\u003e、\u003ccode\u003edepartments\u003c/code\u003e和模式 \u003ccode\u003eproduction\u003c/code\u003e添加到发布 \u003ccode\u003eproduction_publication\u003c/code\u003e中：\u003c/p\u003e\u003cpre\u003eALTER PUBLICATION production_publication ADD TABLE users, departments, TABLES IN SCHEMA production;\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e兼容性\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eALTER PUBLICATION\u003c/code\u003e是\u003cspan\u003ePostgreSQL\u003c/span\u003e的一个扩展。\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e另见\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/wiki/sql/create-publication/?v=18\" title=\"CREATE PUBLICATION\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE PUBLICATION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-publication/?v=18\" title=\"DROP PUBLICATION\" rel=\"nofollow\"\u003e\u003cspan\u003eDROP PUBLICATION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-subscription/?v=18\" title=\"CREATE SUBSCRIPTION\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE SUBSCRIPTION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/alter-subscription/?v=18\" title=\"ALTER SUBSCRIPTION\" rel=\"nofollow\"\u003e\u003cspan\u003eALTER SUBSCRIPTION\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","SourceRevision":"1b5ca64c","ContentHash":"6f953a680219910cbedd73a7b218a04a28808a0e1a547a554d576d56245aeb5d","Payload":{"purpose_zh":"修改发布的定义","sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eALTER PUBLICATION\u003c/code\u003e命令可更改发布的属性。\u003c/p\u003e\u003cp\u003e前三种形式会更改哪些表或模式属于该发布。\u003ccode class=\"literal\"\u003eSET\u003c/code\u003e子句会用指定列表替换发布中的表或模式列表；原先已在该发布中的表或模式将被移除。\u003ccode class=\"literal\"\u003eADD\u003c/code\u003e和\u003ccode class=\"literal\"\u003eDROP\u003c/code\u003e子句则会向发布中添加或移除一个或多个表或模式。请注意，向已经被订阅的发布中添加表或模式后，需要在订阅端执行 \u003ca href=\"/docs/18/sql-altersubscription.html#SQL-ALTERSUBSCRIPTION-PARAMS-REFRESH-PUBLICATION\"\u003e\u003ccode class=\"literal\"\u003eALTER SUBSCRIPTION ... REFRESH PUBLICATION\u003c/code\u003e\u003c/a\u003e 操作后才会生效。还要注意，\u003ccode class=\"literal\"\u003eDROP TABLES IN SCHEMA\u003c/code\u003e 不会移除那些位于模式中、但通过 \u003ca href=\"/docs/18/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-TABLE\"\u003e\u003ccode class=\"literal\"\u003eFOR TABLE\u003c/code\u003e\u003c/a\u003e/\u003ccode class=\"literal\"\u003eADD TABLE\u003c/code\u003e 单独指定的表。\u003c/p\u003e\u003cp\u003e提要中列出的第四种形式可更改\u003ca href=\"/docs/18/sql-createpublication.html\" title=\"CREATE PUBLICATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE PUBLICATION\u003c/span\u003e\u003c/a\u003e中指定的所有发布属性。命令中未提及的属性会保留其先前的设置。\u003c/p\u003e\u003cp\u003e其余几种形式用于更改发布的所有者和名称。\u003c/p\u003e\u003cp\u003e要使用\u003ccode class=\"command\"\u003eALTER PUBLICATION\u003c/code\u003e，你必须拥有该发布。向发布中添加表还要求拥有该表。对发布执行 \u003ccode class=\"literal\"\u003eADD TABLES IN SCHEMA\u003c/code\u003e和 \u003ccode class=\"literal\"\u003eSET TABLES IN SCHEMA\u003c/code\u003e要求调用用户为超级用户。要更改所有者，你必须能够对新的拥有角色执行\u003ccode class=\"literal\"\u003eSET ROLE\u003c/code\u003e，并且该角色必须在数据库上具有\u003ccode class=\"literal\"\u003eCREATE\u003c/code\u003e权限。此外，\u003ca href=\"/docs/18/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-ALL-TABLES\"\u003e\u003ccode class=\"literal\"\u003eFOR ALL TABLES\u003c/code\u003e\u003c/a\u003e 或\u003ca href=\"/docs/18/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-TABLES-IN-SCHEMA\"\u003e\u003ccode class=\"literal\"\u003eFOR TABLES IN SCHEMA\u003c/code\u003e\u003c/a\u003e 发布的新所有者也必须是超级用户。不过，超级用户可以不受这些限制而更改发布的所有权。\u003c/p\u003e\u003cp\u003e如果某个发布还发布了带列列表的表，则不支持向其中添加或设置任何模式；反之亦然。\u003c/p\u003e","key":"description","title":"描述"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e要更改其定义的现有发布名称。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e现有表的名称。如果在表名前指定了\u003ccode class=\"literal\"\u003eONLY\u003c/code\u003e，则只有该表受影响。如果未指定\u003ccode class=\"literal\"\u003eONLY\u003c/code\u003e，则该表及其所有后代表（如果有）都会受影响。还可以在表名后指定\u003ccode class=\"literal\"\u003e*\u003c/code\u003e，以显式指明包含后代表。\u003c/p\u003e\u003cp\u003e还可以指定列列表。详见\u003ca href=\"/docs/18/sql-createpublication.html\" title=\"CREATE PUBLICATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE PUBLICATION\u003c/span\u003e\u003c/a\u003e。请注意，不支持这样的订阅：它包含多个发布，并且同一张表在这些发布中使用不同的列列表发布。有关更改列列表时可能出现的问题，详见\u003ca href=\"/docs/18/logical-replication-col-lists.html#LOGICAL-REPLICATION-COL-LIST-COMBINING\" title=\"警告：组合来自多个发布的列列表\"\u003e警告：组合来自多个发布的列列表\u003c/a\u003e。\u003c/p\u003e\u003cp\u003e如果指定了可选的\u003ccode class=\"literal\"\u003eWHERE\u003c/code\u003e子句，则 \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e计算结果为 false 或 null 的行不会被发布。请注意，表达式外围必须有括号。\u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e会使用复制连接所用的角色来求值。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e现有模式的名称。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eSET ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_parameter\u003c/code\u003e\u003c/em\u003e [= \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e] [, ... ] )\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e该子句用于更改最初由\u003ca href=\"/docs/18/sql-createpublication.html\" title=\"CREATE PUBLICATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE PUBLICATION\u003c/span\u003e\u003c/a\u003e设置的发布参数。详见该命令的说明。\u003c/p\u003e\u003cdiv class=\"caution\"\u003e\u003ch3\u003e小心\u003c/h3\u003e\u003cp\u003e更改 \u003ccode class=\"literal\"\u003epublish_via_partition_root\u003c/code\u003e 参数可能导致订阅端发生数据丢失或重复，因为它会改变已发布表的标识和模式。请注意，只有当根分区表被指定为复制目标时，才会发生此问题。\u003c/p\u003e\u003cp\u003e可通过以下方式避免此问题：在执行 \u003ccode class=\"command\"\u003eALTER PUBLICATION ... SET\u003c/code\u003e之后、执行 \u003ca href=\"/docs/18/sql-altersubscription.html\" title=\"ALTER SUBSCRIPTION\"\u003e\u003ccode class=\"command\"\u003eALTER SUBSCRIPTION ... REFRESH PUBLICATION\u003c/code\u003e\u003c/a\u003e 之前，不修改分区叶子表；并且刷新时仅使用 \u003ccode class=\"literal\"\u003ecopy_data = off\u003c/code\u003e选项。\u003c/p\u003e\u003c/div\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_owner\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e发布的新所有者的用户名。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e发布的新名称。\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"参数"},{"html":"\u003cp\u003e将发布修改为只发布删除和更新：\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER PUBLICATION noinsert SET (publish = 'update, delete');\n\u003c/pre\u003e\u003cp\u003e向发布中添加一些表：\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER PUBLICATION mypublication ADD TABLE users (user_id, firstname), departments;\n\u003c/pre\u003e\u003cp\u003e更改某个表所发布的列集合：\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER PUBLICATION mypublication SET TABLE users (user_id, firstname, lastname), TABLE departments;\n\u003c/pre\u003e\u003cp\u003e将模式\u003ccode class=\"structname\"\u003emarketing\u003c/code\u003e和\u003ccode class=\"structname\"\u003esales\u003c/code\u003e 添加到发布\u003ccode class=\"structname\"\u003esales_publication\u003c/code\u003e中：\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER PUBLICATION sales_publication ADD TABLES IN SCHEMA marketing, sales;\n\u003c/pre\u003e\u003cp\u003e将表\u003ccode class=\"structname\"\u003eusers\u003c/code\u003e、\u003ccode class=\"structname\"\u003edepartments\u003c/code\u003e和模式 \u003ccode class=\"structname\"\u003eproduction\u003c/code\u003e添加到发布 \u003ccode class=\"structname\"\u003eproduction_publication\u003c/code\u003e中：\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER PUBLICATION production_publication ADD TABLE users, departments, TABLES IN SCHEMA production;\n\u003c/pre\u003e","key":"examples","title":"示例"},{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eALTER PUBLICATION\u003c/code\u003e是\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e的一个扩展。\u003c/p\u003e","key":"compatibility","title":"兼容性"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/create-publication/?v=18\" title=\"CREATE PUBLICATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE PUBLICATION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-publication/?v=18\" title=\"DROP PUBLICATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eDROP PUBLICATION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-subscription/?v=18\" title=\"CREATE SUBSCRIPTION\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE SUBSCRIPTION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/alter-subscription/?v=18\" title=\"ALTER SUBSCRIPTION\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER SUBSCRIPTION\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"另见"}],"sections_same_as":"","synopsis_html":"ALTER PUBLICATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e ADD \u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_object\u003c/code\u003e\u003c/em\u003e [, ...]\nALTER PUBLICATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e SET \u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_object\u003c/code\u003e\u003c/em\u003e [, ...]\nALTER PUBLICATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e DROP \u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_drop_object\u003c/code\u003e\u003c/em\u003e [, ...]\nALTER PUBLICATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e SET ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_parameter\u003c/code\u003e\u003c/em\u003e [= \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e] [, ... ] )\nALTER PUBLICATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e OWNER TO { \u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_owner\u003c/code\u003e\u003c/em\u003e | CURRENT_ROLE | CURRENT_USER | SESSION_USER }\nALTER PUBLICATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e RENAME TO \u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_name\u003c/code\u003e\u003c/em\u003e\n\n\u003cspan class=\"phrase\"\u003e其中\u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_object\u003c/code\u003e\u003c/em\u003e可以是：\u003c/span\u003e\n\n    TABLE \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_and_columns\u003c/code\u003e\u003c/em\u003e [, ... ]\n    TABLES IN SCHEMA { \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema_name\u003c/code\u003e\u003c/em\u003e | CURRENT_SCHEMA } [, ... ]\n\n\u003cspan class=\"phrase\"\u003e其中\u003cem class=\"replaceable\"\u003e\u003ccode\u003epublication_drop_object\u003c/code\u003e\u003c/em\u003e可以是：\u003c/span\u003e\n\n    TABLE [ ONLY ] \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_name\u003c/code\u003e\u003c/em\u003e [ * ] [, ... ]\n    TABLES IN SCHEMA { \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema_name\u003c/code\u003e\u003c/em\u003e | CURRENT_SCHEMA } [, ... ]\n\n\u003cspan class=\"phrase\"\u003e其中\u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_and_columns\u003c/code\u003e\u003c/em\u003e是：\u003c/span\u003e\n\n    [ ONLY ] \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_name\u003c/code\u003e\u003c/em\u003e [ * ] [ ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003ecolumn_name\u003c/code\u003e\u003c/em\u003e [, ... ] ) ] [ WHERE ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e ) ]","synopsis_text":"ALTER PUBLICATION name ADD publication_object [, ...]\nALTER PUBLICATION name SET publication_object [, ...]\nALTER PUBLICATION name DROP publication_drop_object [, ...]\nALTER PUBLICATION name SET ( publication_parameter [= value] [, ... ] )\nALTER PUBLICATION name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }\nALTER PUBLICATION name RENAME TO new_name\n其中publication_object可以是：\n\nTABLE table_and_columns [, ... ]\nTABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ]\n\n其中publication_drop_object可以是：\n\nTABLE [ ONLY ] table_name [ * ] [, ... ]\nTABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ]\n\n其中table_and_columns是：\n\n[ ONLY ] table_name [ * ] [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ]"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
