Re: Updated INSERT/UPDATE RETURNING - Mailing list pgsql-patches

From Tom Lane
Subject Re: Updated INSERT/UPDATE RETURNING
Date
Msg-id 869.1154799812@sss.pgh.pa.us
Whole thread Raw
In response to Updated INSERT/UPDATE RETURNING  ("Jonah H. Harris" <jonah.harris@gmail.com>)
Responses Re: Updated INSERT/UPDATE RETURNING  ("Jonah H. Harris" <jonah.harris@gmail.com>)
Re: Updated INSERT/UPDATE RETURNING  ("Jonah H. Harris" <jonah.harris@gmail.com>)
List pgsql-patches
"Jonah H. Harris" <jonah.harris@gmail.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

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] log_statement output for protocol
Next
From: "Jonah H. Harris"
Date:
Subject: Re: Updated INSERT/UPDATE RETURNING