table of contents
ALTER SUBSCRIPTION(7) | PostgreSQL 13.17 Documentation | ALTER SUBSCRIPTION(7) |
NAME¶
ALTER_SUBSCRIPTION - change the definition of a subscription
SYNOPSIS¶
ALTER SUBSCRIPTION name CONNECTION 'conninfo' ALTER SUBSCRIPTION name SET PUBLICATION publication_name [, ...] [ WITH ( set_publication_option [= value] [, ... ] ) ] ALTER SUBSCRIPTION name REFRESH PUBLICATION [ WITH ( refresh_option [= value] [, ... ] ) ] ALTER SUBSCRIPTION name ENABLE ALTER SUBSCRIPTION name DISABLE ALTER SUBSCRIPTION name SET ( subscription_parameter [= value] [, ... ] ) ALTER SUBSCRIPTION name OWNER TO { new_owner | CURRENT_USER | SESSION_USER } ALTER SUBSCRIPTION name RENAME TO new_name
DESCRIPTION¶
ALTER SUBSCRIPTION can change most of the subscription properties that can be specified in CREATE SUBSCRIPTION (CREATE_SUBSCRIPTION(7)).
You must own the subscription to use ALTER 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
CONNECTION 'conninfo'
SET PUBLICATION publication_name
set_publication_option specifies additional options for this operation. The supported options are:
refresh (boolean)
Additionally, refresh options as described under REFRESH PUBLICATION may be specified.
REFRESH PUBLICATION
refresh_option specifies additional options for the refresh operation. The supported options are:
copy_data (boolean)
ENABLE
DISABLE
SET ( subscription_parameter [= value] [, ... ] )
new_owner
new_name
EXAMPLES¶
Change the publication subscribed by a subscription to insert_only:
ALTER SUBSCRIPTION mysub SET PUBLICATION insert_only;
Disable (stop) the subscription:
ALTER SUBSCRIPTION mysub DISABLE;
COMPATIBILITY¶
ALTER SUBSCRIPTION is a PostgreSQL extension.
SEE ALSO¶
CREATE SUBSCRIPTION (CREATE_SUBSCRIPTION(7)), DROP SUBSCRIPTION (DROP_SUBSCRIPTION(7)), CREATE PUBLICATION (CREATE_PUBLICATION(7)), ALTER PUBLICATION (ALTER_PUBLICATION(7))
2024 | PostgreSQL 13.17 |