Re: PL/pgSQL: SELECT INTO EXACT - Mailing list pgsql-patches

From Matt Miller
Subject Re: PL/pgSQL: SELECT INTO EXACT
Date
Msg-id 1123534870.3062.56.camel@dbamm01-linux
Whole thread Raw
In response to Re: PL/pgSQL: SELECT INTO EXACT  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PL/pgSQL: SELECT INTO EXACT
List pgsql-patches
On Fri, 2005-07-29 at 17:52 -0400, Tom Lane wrote:
> Matt Miller <mattm@epx.com> writes:
> > This patch implements an optional EXACT keyword after the INTO keyword
> > of the PL/pgSQL SELECT INTO command.  ... when SELECTing INTO ...
> > leave the targets untouched if the query does not
> > return exactly one row.
>
> I dislike the choice of "EXACT", too, as it (a) adds a new reserved word
> and (b) doesn't seem to convey quite what is happening anyway.  Not sure
> about a better word though ... anyone?

I don't know how to avoid adding a keyword, unless the proposed EXACT
behavior just replaces the current behavior, potentially breaking
existing code.  Is there a precedent for language-specific GUC vars?

I think the EXACT behavior is more reasonable overall, and maybe a
stepped approach can replace the current behavior with the EXACT flavor.
To that end the option could support either EXACT or NOEXACT, with
NOEXACT initially being the default.  Eventually EXACT could become the
default, and finally the NOEXACT option could be dropped altogether.  At
that point the EXACT keyword would be dropped as well.

I can attach a patch that supports [EXACT | NOEXACT].

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Implementing SELECT FOR UPDATE [NOWAIT]
Next
From: Tom Lane
Date:
Subject: Re: PL/pgSQL: SELECT INTO EXACT