Re: GSOC13 proposal - extend RETURNING syntax

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Karol Trzcionka <karlikt(at)gmail(dot)com>, Boszormenyi Zoltan <zb(at)cybertec(dot)at>, David Fetter <david(at)fetter(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Tiikkaja <marko(at)joh(dot)to>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GSOC13 proposal - extend RETURNING syntax
Date: 2013-10-04 13:40:08
Message-ID: 20131004134008.GP19661@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-10-04 13:44:02 Re: Any reasons to not move pgstattuple to core?
Previous Message David Rowley 2013-10-04 13:26:02 Re: space reserved for WAL record does not match what was written: panic on windows