Hi,

On 2025-05-20 16:18:57 -0400, Tom Lane wrote:
> Andres Freund <and...@anarazel.de> writes:
> >> I'm tempted to back-patch this: the plan tree damage seems harmless at
> >> present, but maybe it'd become less harmless with future fixes.
> 
> > There are *some* cases where this changes the explain output, but but the 
> > new
> > output is more correct, I think:
> > ...
> > I suspect this is an argument for backpatching, not against - seems that
> > deparsing could end up creating bogus output in cases where it could matter?
> > Not sure if such cases are reachable via views (and thus pg_dump) or
> > postgres_fdw, but it seems possible.
> 
> I don't believe that we guarantee EXPLAIN output to be 100% valid SQL,
> so I doubt there's a correctness argument here; certainly it'd not
> affect pg_dump.

I wasn't thinking of EXPLAIN itself, but was wondering whether it's possible
to create a view, rule or such that is affected by the output change. Would be
a weird case, if it existed.


> I'm curious though: what was the test case you were looking at?

It's a modified query from our regression tests, I had added some debugging to
find cases where the targetlists differed.  I attached the extracted, somewhat
modified, sql script.

Greetings,

Andres Freund

Attachment: repro-dml-returning.sql
Description: application/sql

Reply via email to