4 DROP SUBSCRIPTION — remove a subscription
8 DROP SUBSCRIPTION [ IF EXISTS ] name [ CASCADE | RESTRICT ]
12 DROP SUBSCRIPTION removes a subscription from the database cluster.
14 To execute this command the user must be the owner of the subscription.
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.)
23 The name of a subscription to be dropped.
27 These key words do not have any effect, since there are no
28 dependencies on subscriptions.
32 When dropping a subscription that is associated with a replication slot
33 on the remote host (the normal state), DROP SUBSCRIPTION will connect
34 to the remote host and try to drop the replication slot (and any
35 remaining table synchronization slots) as part of its operation. This
36 is necessary so that the resources allocated for the subscription on
37 the remote host are released. If this fails, either because the remote
38 host is not reachable or because the remote replication slot cannot be
39 dropped or does not exist or never existed, the DROP SUBSCRIPTION
40 command will fail. To proceed in this situation, first disable the
41 subscription by executing ALTER SUBSCRIPTION ... DISABLE, and then
42 disassociate it from the replication slot by executing ALTER
43 SUBSCRIPTION ... SET (slot_name = NONE). After that, DROP SUBSCRIPTION
44 will no longer attempt any actions on a remote host. Note that if the
45 remote replication slot still exists, it (and any related table
46 synchronization slots) should then be dropped manually; otherwise
47 it/they will continue to reserve WAL and might eventually cause the
48 disk to fill up. See also Section 29.2.1.
50 If a subscription is associated with a replication slot, then DROP
51 SUBSCRIPTION cannot be executed inside a transaction block.
56 DROP SUBSCRIPTION mysub;
60 DROP SUBSCRIPTION is a PostgreSQL extension.
64 CREATE SUBSCRIPTION, ALTER SUBSCRIPTION