Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
ALTER PUBLICATION
Prev UpSQL CommandsHome Next

ALTER PUBLICATION

ALTER PUBLICATION — change the definition of a publication

Synopsis

ALTER PUBLICATIONname ADD TABLE [ ONLY ]table_name [ * ] [, ...]ALTER PUBLICATIONname SET TABLE [ ONLY ]table_name [ * ] [, ...]ALTER PUBLICATIONname DROP TABLE [ ONLY ]table_name [ * ] [, ...]ALTER PUBLICATIONname SET (publication_parameter [=value] [, ... ] )ALTER PUBLICATIONname OWNER TO {new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }ALTER PUBLICATIONname RENAME TOnew_name

Description

The commandALTER PUBLICATION can change the attributes of a publication.

The first three variants change which tables are part of the publication. TheSET TABLE clause will replace the list of tables in the publication with the specified one. TheADD TABLE andDROP TABLE clauses will add and remove one or more tables from the publication. Note that adding tables to a publication that is already subscribed to will require aALTER SUBSCRIPTION ... REFRESH PUBLICATION action on the subscribing side in order to become effective.

The fourth variant of this command listed in the synopsis can change all of the publication properties specified inCREATE PUBLICATION. Properties not mentioned in the command retain their previous settings.

The remaining variants change the owner and the name of the publication.

You must own the publication to useALTER PUBLICATION. Adding a table to a publication additionally requires owning that table. To alter the owner, you must also be a direct or indirect member of the new owning role. The new owner must haveCREATE privilege on the database. Also, the new owner of aFOR ALL TABLES publication must be a superuser. However, a superuser can change the ownership of a publication regardless of these restrictions.

Parameters

name

The name of an existing publication whose definition is to be altered.

table_name

Name of an existing table. IfONLY is specified before the table name, only that table is affected. IfONLY is not specified, the table and all its descendant tables (if any) are affected. Optionally,* can be specified after the table name to explicitly indicate that descendant tables are included.

SET (publication_parameter [=value] [, ... ] )

This clause alters publication parameters originally set byCREATE PUBLICATION. See there for more information.

new_owner

The user name of the new owner of the publication.

new_name

The new name for the publication.

Examples

Change the publication to publish only deletes and updates:

ALTER PUBLICATION noinsert SET (publish = 'update, delete');

Add some tables to the publication:

ALTER PUBLICATION mypublication ADD TABLE users, departments;

Compatibility

ALTER PUBLICATION is aPostgres Pro extension.


Prev Up Next
ALTER PROFILE Home ALTER ROLE
pdfepub
Go to Postgres Pro Standard 14
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp