Re: GSOC13 proposal - extend RETURNING syntax - Mailing list pgsql-hackers

From Andres Freund
Subject Re: GSOC13 proposal - extend RETURNING syntax
Date
Msg-id 20131004134008.GP19661@awork2.anarazel.de
Whole thread Raw
In response to Re: GSOC13 proposal - extend RETURNING syntax  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 2013-10-03 20:51:08 -0400, Robert Haas wrote:
> On Thu, Oct 3, 2013 at 7:54 PM, Karol Trzcionka <karlikt@gmail.com> wrote:
> > Compare EXPLAIN ANALYZE VERBOSE on your statement and on "patched"
> > workflow. I can see significant difference. And your "after" returns the
> > value after whole the work (after trigger fired) as I know (I don't know
> > if it is needed or not, I only point at the difference).
> 
> Sure, I'm not saying we should implement it that way.  I'm just
> pointing out that the ability already exists, at the executor level,
> to return either tuple.  So I think the executor itself shouldn't need
> to be changed; it's just a matter of getting the correct plan tree to
> pop out.

Note what pullups ExecDelete is doing to return the old tuple
though... So, based on precedent special executor support is not an
unlikely thing to be required for a proper implemenation. As Marko
mentions, any trivial implementation not doing playing dirty like that
will refer to the wrong version of the tuple.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: space reserved for WAL record does not match what was written: panic on windows
Next
From: Robert Haas
Date:
Subject: Re: Any reasons to not move pgstattuple to core?