Re: [DOC] Update ALTER SUBSCRIPTION documentation

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Robert Sjöblom <robert(dot)sjoblom(at)fortnox(dot)se>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [DOC] Update ALTER SUBSCRIPTION documentation
Date: 2023-05-08 03:38:53
Message-ID: CAHut+Pt6PYiMy16MdL1+y5s6YeVQ48CtRxP2COobpNMiGs86iQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 5, 2023 at 11:17 PM Robert Sjöblom
<robert(dot)sjoblom(at)fortnox(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhijie Hou (Fujitsu) 2023-05-08 03:52:44 RE: Perform streaming logical transactions by background workers and parallel apply
Previous Message Michael Paquier 2023-05-08 03:14:58 Re: Add PQsendSyncMessage() to libpq