1ALTER SUBSCRIPTION(7)    PostgreSQL 12.6 Documentation   ALTER SUBSCRIPTION(7)
2
3
4

NAME

6       ALTER_SUBSCRIPTION - change the definition of a subscription
7

SYNOPSIS

9       ALTER SUBSCRIPTION name CONNECTION 'conninfo'
10       ALTER SUBSCRIPTION name SET PUBLICATION publication_name [, ...] [ WITH ( set_publication_option [= value] [, ... ] ) ]
11       ALTER SUBSCRIPTION name REFRESH PUBLICATION [ WITH ( refresh_option [= value] [, ... ] ) ]
12       ALTER SUBSCRIPTION name ENABLE
13       ALTER SUBSCRIPTION name DISABLE
14       ALTER SUBSCRIPTION name SET ( subscription_parameter [= value] [, ... ] )
15       ALTER SUBSCRIPTION name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
16       ALTER SUBSCRIPTION name RENAME TO new_name
17

DESCRIPTION

19       ALTER SUBSCRIPTION can change most of the subscription properties that
20       can be specified in CREATE SUBSCRIPTION (CREATE_SUBSCRIPTION(7)).
21
22       You must own the subscription to use ALTER SUBSCRIPTION. To alter the
23       owner, you must also be a direct or indirect member of the new owning
24       role. The new owner has to be a superuser. (Currently, all subscription
25       owners must be superusers, so the owner checks will be bypassed in
26       practice. But this might change in the future.)
27

PARAMETERS

29       name
30           The name of a subscription whose properties are to be altered.
31
32       CONNECTION 'conninfo'
33           This clause alters the connection property originally set by CREATE
34           SUBSCRIPTION (CREATE_SUBSCRIPTION(7)). See there for more
35           information.
36
37       SET PUBLICATION publication_name
38           Changes list of subscribed publications. See CREATE SUBSCRIPTION
39           (CREATE_SUBSCRIPTION(7)) for more information. By default this
40           command will also act like REFRESH PUBLICATION.
41
42           set_publication_option specifies additional options for this
43           operation. The supported options are:
44
45           refresh (boolean)
46               When false, the command will not try to refresh table
47               information.  REFRESH PUBLICATION should then be executed
48               separately. The default is true.
49
50           Additionally, refresh options as described under REFRESH
51           PUBLICATION may be specified.
52
53       REFRESH PUBLICATION
54           Fetch missing table information from publisher. This will start
55           replication of tables that were added to the subscribed-to
56           publications since the last invocation of REFRESH PUBLICATION or
57           since CREATE SUBSCRIPTION.
58
59           refresh_option specifies additional options for the refresh
60           operation. The supported options are:
61
62           copy_data (boolean)
63               Specifies whether the existing data in the publications that
64               are being subscribed to should be copied once the replication
65               starts. The default is true. (Previously subscribed tables are
66               not copied.)
67
68
69       ENABLE
70           Enables the previously disabled subscription, starting the logical
71           replication worker at the end of transaction.
72
73       DISABLE
74           Disables the running subscription, stopping the logical replication
75           worker at the end of transaction.
76
77       SET ( subscription_parameter [= value] [, ... ] )
78           This clause alters parameters originally set by CREATE SUBSCRIPTION
79           (CREATE_SUBSCRIPTION(7)). See there for more information. The
80           allowed options are slot_name and synchronous_commit
81
82       new_owner
83           The user name of the new owner of the subscription.
84
85       new_name
86           The new name for the subscription.
87

EXAMPLES

89       Change the publication subscribed by a subscription to insert_only:
90
91           ALTER SUBSCRIPTION mysub SET PUBLICATION insert_only;
92
93       Disable (stop) the subscription:
94
95           ALTER SUBSCRIPTION mysub DISABLE;
96

COMPATIBILITY

98       ALTER SUBSCRIPTION is a PostgreSQL extension.
99

SEE ALSO

101       CREATE SUBSCRIPTION (CREATE_SUBSCRIPTION(7)), DROP SUBSCRIPTION
102       (DROP_SUBSCRIPTION(7)), CREATE PUBLICATION (CREATE_PUBLICATION(7)),
103       ALTER PUBLICATION (ALTER_PUBLICATION(7))
104
105
106
107PostgreSQL 12.6                      2021                ALTER SUBSCRIPTION(7)
Impressum