1DROP SUBSCRIPTION(7)     PostgreSQL 11.3 Documentation    DROP SUBSCRIPTION(7)
2
3
4

NAME

6       DROP_SUBSCRIPTION - remove a subscription
7

SYNOPSIS

9       DROP SUBSCRIPTION [ IF EXISTS ] name [ CASCADE | RESTRICT ]
10

DESCRIPTION

12       DROP SUBSCRIPTION removes a subscription from the database cluster.
13
14       A subscription can only be dropped by a superuser.
15
16       DROP SUBSCRIPTION cannot be executed inside a transaction block if the
17       subscription is associated with a replication slot. (You can use ALTER
18       SUBSCRIPTION to unset the slot.)
19

PARAMETERS

21       name
22           The name of a subscription to be dropped.
23
24       CASCADE
25       RESTRICT
26           These key words do not have any effect, since there are no
27           dependencies on subscriptions.
28

NOTES

30       When dropping a subscription that is associated with a replication slot
31       on the remote host (the normal state), DROP SUBSCRIPTION will connect
32       to the remote host and try to drop the replication slot as part of its
33       operation. This is necessary so that the resources allocated for the
34       subscription on the remote host are released. If this fails, either
35       because the remote host is not reachable or because the remote
36       replication slot cannot be dropped or does not exist or never existed,
37       the DROP SUBSCRIPTION command will fail. To proceed in this situation,
38       disassociate the subscription from the replication slot by executing
39       ALTER SUBSCRIPTION ... SET (slot_name = NONE). After that, DROP
40       SUBSCRIPTION will no longer attempt any actions on a remote host. Note
41       that if the remote replication slot still exists, it should then be
42       dropped manually; otherwise it will continue to reserve WAL and might
43       eventually cause the disk to fill up. See also Section 31.2.1.
44
45       If a subscription is associated with a replication slot, then DROP
46       SUBSCRIPTION cannot be executed inside a transaction block.
47

EXAMPLES

49       Drop a subscription:
50
51           DROP SUBSCRIPTION mysub;
52

COMPATIBILITY

54       DROP SUBSCRIPTION is a PostgreSQL extension.
55

SEE ALSO

57       CREATE SUBSCRIPTION (CREATE_SUBSCRIPTION(7)), ALTER SUBSCRIPTION
58       (ALTER_SUBSCRIPTION(7))
59
60
61
62PostgreSQL 11.3                      2019                 DROP SUBSCRIPTION(7)
Impressum