Re: Updated INSERT/UPDATE RETURNING

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org, "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Updated INSERT/UPDATE RETURNING
Date: 2006-08-05 17:43:32
Message-ID: 869.1154799812@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

"Jonah H. Harris" <jonah(dot)harris(at)gmail(dot)com> writes:
> Here's the updated patch with DELETE RETURNING removed. This isn't
> really an issue because no one wanted DELETE RETURNING to begin with.

Huh? Why'd you remove it? I can't imagine it makes things
significantly simpler to omit that case, and even if you can't
think of uses for it, I can (taking jobs from a to-do queue for
instance).

BTW, it occurs to me to wonder whether we've picked a good choice
of syntax. I don't remember where the suggestion to use "RETURNING"
came from (did we borrow it from another DBMS?). But AFAICS this
syntax will require the introducing keyword to be a fully reserved
word, and since RETURNING is not listed as a reserved word in the
SQL spec, reserving it is arguably a spec violation.

The simplest alternative that comes to mind is to use RETURNS instead of
RETURNING; since RETURNS is listed as reserved, this doesn't violate
spec. OTOH we currently treat RETURNS as an unreserved keyword, and
we'd have to promote it to fully reserved. It could be argued that
"returns" is a more likely name for a table column than "returning";
if so we'd actually be more likely to break existing apps this way.

I don't have a strong feeling either way, but now is the time to
decide.

> It is important to note that this patch is not yet ready to be
> committed.

OK, but we need a final version soon.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2006-08-05 18:01:37 Re: ecpg test suite
Previous Message Bruce Momjian 2006-08-05 17:39:06 Re: [HACKERS] [PATCHES] log_statement output for protocol

Browse pgsql-patches by date

  From Date Subject
Next Message Jonah H. Harris 2006-08-05 19:20:12 Re: Updated INSERT/UPDATE RETURNING
Previous Message Bruce Momjian 2006-08-05 17:39:06 Re: [HACKERS] [PATCHES] log_statement output for protocol