Hello

It is RETURN TABLE(SQL) via ANSI SQL 2003

Table function support is in patch queue:
http://archives.postgresql.org/pgsql-patches/2007-02/msg00216.php
http://momjian.us/mhonarc/patches/msg00001.html

Regards
Pavel Stehule



In a PL/PgSQL set-returning function, returning the result set of a
query requires a FOR loop and repeated invocations of the RETURN NEXT
statement:

   FOR x in SELECT ... LOOP
       RETURN NEXT x;
   END LOOP;

This works, but it seems overly verbose. It occurred to me that we could
easily add a new PL/PgSQL statement that evaluates a set-returning
expression and adds *all* the resulting rows to the function's result
set. For example:

    RETURN QUERY SELECT ...;

I'm not sure of the right name: "RETURN ROWS" or "RETURN ALL" might also
work. Of course, this is syntax sugar (and superficial sugar at that),
but I believe this is a fairly common requirement.

_________________________________________________________________
Citite se osamele? Poznejte nekoho vyjmecneho diky Match.com. http://www.msn.cz/


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to