Re: "select myfunc(fields) from my table" inside plpgslq - Mailing list pgsql-general

From Stephan Szabo
Subject Re: "select myfunc(fields) from my table" inside plpgslq
Date
Msg-id 20020307071941.G76547-100000@megazone23.bigpanda.com
Whole thread Raw
In response to "select myfunc(fields) from my table" inside plpgslq proc  (Jeff Anto <antojf2001@yahoo.fr>)
List pgsql-general
On Thu, 7 Mar 2002, [iso-8859-1] Jeff Anto wrote:

> Hi all,
> the following is very surprising to me.
> It seems that semantic of
> select INTO var myfunc(...) from ... are different in
> plpgsql program than pure sql
> select myfunc(...) from ...
> should the former take into account only one rows
> while the latter take into account all rows ?

Well, to be honest it should probably error if more
than one row is returned since it seems to be like
a scalar subquery in usage, but I don't think that's
what you want either.  The question is what value
from the select list is put into var when multiple
rows are returned?

> I am sure that in past version (7.1.2 ?) both were
> equivalent...

I don't have 7.1.2, but 7.1.3 seems to act like 7.2 in
this.


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: "select myfunc(fields) from my table" inside plpgslq proc
Next
From: Tom Lane
Date:
Subject: Re: Defined C function gives nondeterministic results