Re: GSOC13 proposal - extend RETURNING syntax

From: David Fetter <david(at)fetter(dot)org>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Tiikkaja <marko(at)joh(dot)to>, Karol Trzcionka <karlikt(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: GSOC13 proposal - extend RETURNING syntax
Date: 2013-05-02 16:52:38
Message-ID: 20130502165238.GB12887@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 02, 2013 at 06:28:53PM +0200, Andres Freund wrote:
> On 2013-05-02 12:23:19 -0400, Tom Lane wrote:
> > Marko Tiikkaja <marko(at)joh(dot)to> writes:
> > > What I'm more interested in is: how can we make this feature work in
> > > PL/PgSQL where OLD means something different?
> >
> > That's a really good point: if you follow this approach then you're
> > creating fundamental conflicts for use of the feature in trigger
> > functions or rules, which will necessarily have conflicting uses of
> > those names. Yeah, we could define scoping rules such that there's
> > an unambiguous interpretation, but then the user is just out of luck
> > if he wants to reference the other definition. (This problem is
> > probably actually worse if you implement with reserved words rather
> > than aliases.)
> >
> > I'm thinking it would be better to invent some other notation for access
> > to old-row values.
>
> prior/after? Both are unreserved keywords atm and it seems far less
> likely to have conflicts than new/old.

BEFORE/AFTER seems more logical to me. Yes, those words both have
meaning in, for example, a trigger definition, but they're clearly
separable by context.

Yay, bike-shedding!

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2013-05-02 17:04:08 Re: high io BUT huge amount of free memory
Previous Message Bruce Momjian 2013-05-02 16:35:17 Re: Remaining beta blockers