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

From ideriha.takeshi@fujitsu.com
Subject RE: The follwing error sometimes happened while updating partitioned table using inheritance; ERROR: attribute xxx of type record has wrong type
Date
Msg-id TYCPR01MB7041496C7DCC4860741D8634EA299@TYCPR01MB7041.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: The follwing error sometimes happened while updating partitioned table using inheritance; ERROR: attribute xxx of type record has wrong type  (Amit Langote <amitlangote09@gmail.com>)
List 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



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17394: pg_dump: query returned 0 rows instead of one:
Next
From: Andres Freund
Date:
Subject: Re: BUG #17255: Server crashes in index_delete_sort_cmp() due to race condition with vacuum