1ALTER SUBSCRIPTION(7)    PostgreSQL 11.3 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.
66
67
68       ENABLE
69           Enables the previously disabled subscription, starting the logical
70           replication worker at the end of transaction.
71
72       DISABLE
73           Disables the running subscription, stopping the logical replication
74           worker at the end of transaction.
75
76       SET ( subscription_parameter [= value] [, ... ] )
77           This clause alters parameters originally set by CREATE SUBSCRIPTION
78           (CREATE_SUBSCRIPTION(7)). See there for more information. The
79           allowed options are slot_name and synchronous_commit
80
81       new_owner
82           The user name of the new owner of the subscription.
83
84       new_name
85           The new name for the subscription.
86

EXAMPLES

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

COMPATIBILITY

97       ALTER SUBSCRIPTION is a PostgreSQL extension.
98

SEE ALSO

100       CREATE SUBSCRIPTION (CREATE_SUBSCRIPTION(7)), DROP SUBSCRIPTION
101       (DROP_SUBSCRIPTION(7)), CREATE PUBLICATION (CREATE_PUBLICATION(7)),
102       ALTER PUBLICATION (ALTER_PUBLICATION(7))
103
104
105
106PostgreSQL 11.3                      2019                ALTER SUBSCRIPTION(7)
Impressum