Re: deferred primary key and logical replication

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>
Cc: Euler Taveira <euler(dot)taveira(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: deferred primary key and logical replication
Date: 2020-11-24 01:42:26
Message-ID: CAA4eK1LckCWTge1+xTcEO+Tg2Qy+ref4i9SeQsRtyWTOfx6x4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 24, 2020 at 3:04 AM Anastasia Lubennikova
<a(dot)lubennikova(at)postgrespro(dot)ru> wrote:
>
> On 27.10.2020 13:46, Amit Kapila wrote:
> > On Sun, Oct 25, 2020 at 9:39 PM Euler Taveira
> > <euler(dot)taveira(at)2ndquadrant(dot)com> wrote:
> >> On Mon, 5 Oct 2020 at 08:34, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >>> On Mon, May 11, 2020 at 2:41 AM Euler Taveira
> >>> <euler(dot)taveira(at)2ndquadrant(dot)com> wrote:
> >>>> Hi,
> >>>>
> >>>> While looking at an old wal2json issue, I stumbled on a scenario that a table
> >>>> with a deferred primary key is not updatable in logical replication. AFAICS it
> >>>> has been like that since the beginning of logical decoding and seems to be an
> >>>> oversight while designing logical decoding.
> >>>>
> >>> I am not sure if it is an oversight because we document that the index
> >>> must be non-deferrable, see "USING INDEX records the old values of the
> >>> columns covered by the named index, which must be unique, not partial,
> >>> not deferrable, and include only columns marked NOT NULL." in docs
> >>> [1].
> >>>
> >> Inspecting this patch again, I forgot to consider that RelationGetIndexList()
> >> is called by other backend modules. Since logical decoding deals with finished
> >> transactions, it is ok to use a deferrable primary key.
> >>
> > But starting PG-14, we do support logical decoding of in-progress
> > transactions as well.
> >
> >
> Commitfest entry status update.
> As far as I see, this patch needs some further work, so I move it to
> "Waiting on author".
>

I think this should be marked as "Returned with Feedback" as there is
no response to the feedback for a long time and also it is not very
clear if this possible.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2020-11-24 01:44:45 Re: POC: postgres_fdw insert batching
Previous Message Junfeng Yang 2020-11-24 01:38:40 回复: vac_update_datfrozenxid will raise "wrong tuple length" if pg_database tuple contains toast attribute.