Re: [DOC] Update ALTER SUBSCRIPTION documentation

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Robert Sjöblom <robert(dot)sjoblom(at)fortnox(dot)se>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [DOC] Update ALTER SUBSCRIPTION documentation
Date: 2023-05-08 08:21:18
Message-ID: CAD21AoBmrq6nJv6mv_oNd+SCP96kn2Jbe00dkB9TcO6aHM=5SA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 8, 2023 at 12:07 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Fri, May 5, 2023 at 6:47 PM Robert Sjöblom <robert(dot)sjoblom(at)fortnox(dot)se> wrote:
> >
> > 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.
> >
>
> Shouldn't we also change the following errhint in the code as well?
> ReportSlotConnectionError()
> {
> ...
> ereport(ERROR,
> (errcode(ERRCODE_CONNECTION_FAILURE),
> errmsg("could not connect to publisher when attempting to drop
> replication slot \"%s\": %s",
> slotname, err),
> /* translator: %s is an SQL ALTER command */
> errhint("Use %s to disassociate the subscription from the slot.",
> "ALTER SUBSCRIPTION ... SET (slot_name = NONE)")));
> ...
> }

Yeah, if the subscription is enabled, it might be helpful for users if
the error hint message says something like:

Use ALTER SUBSCRIPTION ... SET (slot_name = NONE) to disassociate the
subscription from the slot after disabling the subscription.

Apart from the documentation change, given that setting slot_name =
NONE always requires for the subscription to be disabled beforehand,
does it make sense to change ALTER SUBSCRIPTION SET so that we disable
the subscription when setting slot_name = NONE? Setting slot_name to a
valid slot name doesn't enable the subscription, though.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2023-05-08 08:39:42 Re: evtcache: EventTriggerCache vs Event Trigger Cache
Previous Message Drouvot, Bertrand 2023-05-08 08:14:37 Re: Add two missing tests in 035_standby_logical_decoding.pl