Re: [DOC] Update ALTER SUBSCRIPTION documentation - Mailing list pgsql-hackers

From Peter Smith
Subject Re: [DOC] Update ALTER SUBSCRIPTION documentation
Date
Msg-id CAHut+Pt6PYiMy16MdL1+y5s6YeVQ48CtRxP2COobpNMiGs86iQ@mail.gmail.com
Whole thread Raw
In response to [DOC] Update ALTER SUBSCRIPTION documentation  (Robert Sjöblom <robert.sjoblom@fortnox.se>)
List pgsql-hackers
On Fri, May 5, 2023 at 11:17 PM Robert Sjöblom
<robert.sjoblom@fortnox.se> wrote:
>
>
> Hi,
>
> We have recently used the PostgreSQL documentation when setting up our
> logical replication. We noticed there was a step missing in the
> documentation on how to drop a logical replication subscription with a
> replication slot attached.
>
> We clarify the documentation to include prerequisites for running the
> DROP SUBSCRIPTION command. Please see attached patch.

Right, there is a "missing step" in the documentation, but OTOH that
step is going to be obvious from the error you get when attempting to
set the slot_name to NONE:

e.g.
test_sub=# ALTER SUBSCRIPTION sub1 SET (slot_name= NONE);
ERROR:  cannot set slot_name = NONE for enabled subscription

~

IMO this scenario is sort of a trade-off between (a) wanting to give
every little step explicitly versus (b) trying to keep the
documentation free of clutter.

I think a comprise here is just to mention the need for disabling the
subscription but without spelling out the details of the ALTER ...
DISABLE command.

For example,

BEFORE
To proceed in this situation, disassociate the subscription from the
replication slot by executing ALTER SUBSCRIPTION ... SET (slot_name =
NONE).

SUGGESTION
To proceed in this situation, first DISABLE the subscription, and then
disassociate it from the replication slot by executing ALTER
SUBSCRIPTION ... SET (slot_name = NONE).

------
Kind Regards,
Peter Smith.
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Add PQsendSyncMessage() to libpq
Next
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Perform streaming logical transactions by background workers and parallel apply