Re: [bug] Logical Decoding of relation rewrite with toast does not reset toast_hash

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: "Drouvot, Bertrand" <bdrouvot(at)amazon(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "Schneider (AWS), Jeremy" <schnjere(at)amazon(dot)com>
Subject: Re: [bug] Logical Decoding of relation rewrite with toast does not reset toast_hash
Date: 2021-08-09 09:38:54
Message-ID: CAFiTN-suMDbyfJbx4tg9_XmwGmVdna8XBt4AJVNA09RU+oXCww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 9, 2021 at 2:07 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Fri, Jul 9, 2021 at 12:22 PM Drouvot, Bertrand <bdrouvot(at)amazon(dot)com> wrote:
> >
> > Please find enclosed a patch proposal to:
> >
> > * Avoid the failed assertion on current master and generate the error message instead (should the code reach that stage).
> > * Reset the toast_hash in case of relation rewrite with toast (so that the logical decoding in the above repro is working).
> >
>
> I think instead of resetting toast_hash for this case why don't we set
> 'relrewrite' for toast tables as well during rewrite? If we do that
> then we will simply skip assembling toast chunks for the toast table.
> In make_new_heap(), we are calling NewHeapCreateToastTable() to create
> toast table where we can pass additional information (probably
> 'toastid'), if required to set 'relrewrite'. Additionally, let's add a
> test case if possible for this.

I agree with Amit, that setting relrewrite for the toast relation as
well is better as we can simply avoid processing the toast tuple as
well in such cases.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Drouvot, Bertrand 2021-08-09 10:07:24 Re: [bug] Logical Decoding of relation rewrite with toast does not reset toast_hash
Previous Message Suraj Khamkar 2021-08-09 09:23:31 Re: Tab completion for CREATE SCHEMAAUTHORIZATION