Re: pgsql: Add ALTER SUBSCRIPTION ... SKIP.

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Amit Kapila <akapila(at)postgresql(dot)org>, pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Add ALTER SUBSCRIPTION ... SKIP.
Date: 2022-03-22 02:53:00
Message-ID: CAA4eK1JKHda3VzhM08MirwYhB+R46kDPE1WMKEEO=4sOO6Y1CQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, Mar 22, 2022 at 7:36 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Amit Kapila <akapila(at)postgresql(dot)org> writes:
> > The user can specify LSN by ALTER SUBSCRIPTION ... SKIP (lsn = XXX),
> > which allows the apply worker to skip the transaction finished at
> > specified LSN. The apply worker skips all data modification changes within
> > the transaction.
>
> Hmm ... this seems like a really poor choice of syntax.
> I would expect ALTER to be used for changes of persistent
> object properties, which surely this is not?
>

We have discussed this syntax and discussed the point that this is
different from other properties of subscription like slot_name, binary
etc. and that is why we used SKIP for it rather than the usual way by
using SET [1][2]. There could also be other such options in future
like XID or other attributes, so we thought it would be easier to
extend it.

> An alternative perhaps could be to invoke the operation
> via a function.
>

I agree that is another alternative but could be inconvenient if there
are multiple such functions. We already have one
pg_replication_origin_advance().

[1] - https://www.postgresql.org/message-id/CAA4eK1KD_C_0LSxaYB0UbG59VOgjf4mXBeSYbVWCLXAnnuqnPw%40mail.gmail.com
[2] - https://www.postgresql.org/message-id/f716f584-65d0-fe83-2e84-53426631739a%40enterprisedb.com

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2022-03-22 04:22:38 pgsql: Fix failures in SSL tests caused by out-of-tree keys and certifi
Previous Message Tom Lane 2022-03-22 02:06:46 Re: pgsql: Add ALTER SUBSCRIPTION ... SKIP.

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2022-03-22 02:56:40 Re: shared-memory based stats collector - v67
Previous Message Andres Freund 2022-03-22 02:48:44 Re: On login trigger: take three