Re: PL/pgSQL: SELECT INTO EXACT

From: Matt Miller <mattm(at)epx(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: PL/pgSQL: SELECT INTO EXACT
Date: 2005-08-08 21:01:09
Message-ID: 1123534870.3062.56.camel@dbamm01-linux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Fri, 2005-07-29 at 17:52 -0400, Tom Lane wrote:
> Matt Miller <mattm(at)epx(dot)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].

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-08-08 21:03:28 Re: Simplifying wal_sync_method
Previous Message Mark Woodward 2005-08-08 20:59:13 Re: shrinking the postgresql.conf

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-08-08 21:18:53 Re: PL/pgSQL: SELECT INTO EXACT
Previous Message Bruce Momjian 2005-08-08 20:26:37 Re: Implementing SELECT FOR UPDATE [NOWAIT]