RE: The follwing error sometimes happened while updating partitioned table using inheritance; ERROR: attribute xxx of type record has wrong type

From: "ideriha(dot)takeshi(at)fujitsu(dot)com" <ideriha(dot)takeshi(at)fujitsu(dot)com>
To: 'Amit Langote' <amitlangote09(at)gmail(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: RE: The follwing error sometimes happened while updating partitioned table using inheritance; ERROR: attribute xxx of type record has wrong type
Date: 2022-02-04 01:01:46
Message-ID: TYCPR01MB7041496C7DCC4860741D8634EA299@TYCPR01MB7041.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi, thank you for your kind replay.

>> Would you hit upon any other work arounds?
>
>Have you considered not using the sub-select expression in the UPDATE targetlist? That is, doesn't the following query, which doesn't use the subquery expression, do the same job as the original >query:
>
>update a set a = wk.x::char(10), b = wk.x, c = wk.y from b wk where wk.x = a.b and a.a = '2017';

Thank you, it seems work in my test cases.
I misunderstood that SubLink (and following SubPlan) is always made
from update on a partitioned table,
but it actually made from subquery in update target list.

Regards.
Takeshi Ideriha

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2022-02-04 04:19:35 Re: BUG #17255: Server crashes in index_delete_sort_cmp() due to race condition with vacuum
Previous Message Etsuro Fujita 2022-02-04 00:56:42 Re: BUG #17355: Server crashes on ExecReScanForeignScan in postgres_fdw when accessing foreign partition