Re: Incorrect explain output for updates/delete operations with returning-list on partitioned tables - Mailing list pgsql-hackers

From David Rowley
Subject Re: Incorrect explain output for updates/delete operations with returning-list on partitioned tables
Date
Msg-id CAApHDvoUd8RLjbvcm+wPJ_PPtB0wWbjonpN00zFsHj=oH_mr+w@mail.gmail.com
Whole thread Raw
In response to Re: Incorrect explain output for updates/delete operations with returning-list on partitioned tables  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, 7 May 2024 at 09:18, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> SAIKIRAN AVULA <avulasaikiranreddy@gmail.com> writes:
> > I have been working on partitioned tables recently, and I have noticed
> > something that doesn't seem correct with the EXPLAIN output of an
> > update/delete query with a returning list.
>
> What do you think is not right exactly?  The output has to use some
> one of the correlation names for the partitioned table.  I think
> it generally chooses the one corresponding to the first Append arm,
> but really any would be good enough for EXPLAIN's purposes.

Also looks harmless to me.  But just a slight correction, you're
talking about the deparse Append condition that's in
set_deparse_plan().  Whereas the code that controls this for the
returningList is the following in nodeModifyTable.c:

/*
* Initialize result tuple slot and assign its rowtype using the first
* RETURNING list.  We assume the rest will look the same.
*/
mtstate->ps.plan->targetlist = (List *) linitial(node->returningLists);

David



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: backend stuck in DataFileExtend
Next
From: Tom Lane
Date:
Subject: WHERE CURRENT OF with RLS quals that are ctid conditions