Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
ALTER SUBSCRIPTION
Prev UpSQL CommandsHome Next

ALTER SUBSCRIPTION

ALTER SUBSCRIPTION — change the definition of a subscription

Synopsis

ALTER SUBSCRIPTIONname CONNECTION 'conninfo'ALTER SUBSCRIPTIONname SET PUBLICATIONpublication_name [, ...] [ WITH (set_publication_option [=value] [, ... ] ) ]ALTER SUBSCRIPTIONname REFRESH PUBLICATION [ WITH (refresh_option [=value] [, ... ] ) ]ALTER SUBSCRIPTIONname ENABLEALTER SUBSCRIPTIONname DISABLEALTER SUBSCRIPTIONname SET (subscription_parameter [=value] [, ... ] )ALTER SUBSCRIPTIONname OWNER TO {new_owner | CURRENT_USER | SESSION_USER }ALTER SUBSCRIPTIONname RENAME TOnew_name

Description

ALTER SUBSCRIPTION can change most of the subscription properties that can be specified inCREATE SUBSCRIPTION.

You must own the subscription to useALTER SUBSCRIPTION. To alter the owner, you must also be a direct or indirect member of the new owning role. The new owner has to be a superuser. (Currently, all subscription owners must be superusers, so the owner checks will be bypassed in practice. But this might change in the future.)

Parameters

name

The name of a subscription whose properties are to be altered.

CONNECTION 'conninfo'

This clause alters the connection property originally set byCREATE SUBSCRIPTION. See there for more information.

SET PUBLICATIONpublication_name

Changes list of subscribed publications. SeeCREATE SUBSCRIPTION for more information. By default this command will also act likeREFRESH PUBLICATION.

set_publication_option specifies additional options for this operation. The supported options are:

refresh (boolean)

When false, the command will not try to refresh table information.REFRESH PUBLICATION should then be executed separately. The default istrue.

Additionally, refresh options as described underREFRESH PUBLICATION may be specified.

REFRESH PUBLICATION

Fetch missing table information from publisher. This will start replication of tables that were added to the subscribed-to publications since the last invocation ofREFRESH PUBLICATION or sinceCREATE SUBSCRIPTION.

refresh_option specifies additional options for the refresh operation. The supported options are:

copy_data (boolean)

Specifies whether the existing data in the publications that are being subscribed to should be copied once the replication starts. The default istrue. (Previously subscribed tables are not copied.)

ENABLE

Enables the previously disabled subscription, starting the logical replication worker at the end of transaction.

DISABLE

Disables the running subscription, stopping the logical replication worker at the end of transaction.

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

This clause alters parameters originally set byCREATE SUBSCRIPTION. See there for more information. The allowed options areslot_name andsynchronous_commit

new_owner

The user name of the new owner of the subscription.

new_name

The new name for the subscription.

Examples

Change the publication subscribed by a subscription toinsert_only:

ALTER SUBSCRIPTION mysub SET PUBLICATION insert_only;

Disable (stop) the subscription:

ALTER SUBSCRIPTION mysub DISABLE;

Compatibility

ALTER SUBSCRIPTION is aPostgreSQL extension.


Prev Up Next
ALTER STATISTICS Home ALTER SYSTEM
epubpdf
Go to PostgreSQL 10
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp