Re: PL/pgSQL: SELECT INTO EXACT

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Matt Miller <mattm(at)epx(dot)com>, pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: PL/pgSQL: SELECT INTO EXACT
Date: 2005-07-29 22:04:52
Message-ID: c2d9e70e05072915047223be0b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On 7/29/05, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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. 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
>

just wonder, why that is not the default behavior of the SELECT INTO?
at least, the first time i think the function was right until i found
that the first row of a set of rows was assigned...

i mean, when you do that code you are expecting just one row from your
query, doesn't you?

--
Atentamente,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2005-07-29 22:06:18 Re: [HACKERS] Autovacuum loose ends
Previous Message Tom Lane 2005-07-29 21:52:55 Re: PL/pgSQL: SELECT INTO EXACT

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2005-07-29 22:06:18 Re: [HACKERS] Autovacuum loose ends
Previous Message Tom Lane 2005-07-29 21:52:55 Re: PL/pgSQL: SELECT INTO EXACT