Skip site navigation (1) Skip section navigation (2)

Re: PL/pgSQL: SELECT INTO EXACT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matt Miller <mattm(at)epx(dot)com>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: PL/pgSQL: SELECT INTO EXACT
Date: 2005-07-29 21:52:55
Message-ID: 21957.1122673975@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
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.  The motivation is to come closer
> to Oracle's SELECT INTO behavior: when SELECTing INTO scalar targets,
> raise an exception and leave the targets untouched if the query does not
> return exactly one row.  This patch does not go so far as to raise an
> exception, but it can simplify porting efforts from PL/SQL.

Uh, what's the point of being only sort-of compatible?  Why not throw
the exception?

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?

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Jaime CasanovaDate: 2005-07-29 22:04:52
Subject: Re: PL/pgSQL: SELECT INTO EXACT
Previous:From: Tom LaneDate: 2005-07-29 21:46:11
Subject: Re: [HACKERS] Autovacuum loose ends

pgsql-patches by date

Next:From: Jaime CasanovaDate: 2005-07-29 22:04:52
Subject: Re: PL/pgSQL: SELECT INTO EXACT
Previous:From: Tom LaneDate: 2005-07-29 21:46:11
Subject: Re: [HACKERS] Autovacuum loose ends

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group