Search Postgresql Archives

Re: set-valued function called in context that cannot accept a set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mar 6, 2009, at 3:27 PM, Raymond O'Donnell wrote:

When a function returns SETOF something, you need to treat it as if it
were a table, thus:

  select * from unnest2(...);

Except that isn't true if the function is written in C.

CREATE OR REPLACE FUNCTION unnest(anyarray)
RETURNS SETOF anyelement AS 'unnest'
LANGUAGE 'C' IMMUTABLE;

	SELECT unnest(...);

works just fine using the above defined C function.

So my question is really, what's the difference and why doesn't this work with PL/PGSQL functions?

eric

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux