RE: [BUG]Update Toast data failure in logical replication

From: "tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: [BUG]Update Toast data failure in logical replication
Date: 2021-06-02 09:07:08
Message-ID: OS0PR01MB6113DE0DE33A59A5240A9B6FFB3D9@OS0PR01MB6113.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 2, 2021 2:44 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> Attached patch fixes that, I haven't yet added the test case. Once
> someone confirms on the approach then I will add a test case to the
> patch.

key_tuple = heap_form_tuple(desc, values, nulls);
*copy = true;
...
key_tuple = toast_flatten_tuple(oldtup, desc);
heap_freetuple(oldtup);
}
+ /*
+ * If key tuple doesn't have any external data and key is not changed then
+ * just free the key tuple and return NULL.
+ */
+ else if (!key_changed)
+ {
+ heap_freetuple(key_tuple);
+ return NULL;
+ }

return key_tuple;
}

I think "*copy = false" should be added before return NULL because we don't return a modified copy tuple here. Thoughts?

Regards
Tang

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-06-02 09:16:08 Re: Update maintenance_work_mem/autovacuum_work_mem to reflect the 1GB limitation with VACUUM
Previous Message Amit Langote 2021-06-02 08:40:32 Re: join pushdown and issue with foreign update