Search Postgresql Archives

Re: http://www.postgresql.org/docs/8.0/static/xfunc-sql.html

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

 



Adam Witney <awitney@xxxxxxxxxx> writes:
> Ah you want to return a record I suppose?

> CREATE TABLE test (id int, name text);
> INSERT INTO test VALUES(1, 'me');
> INSERT INTO test VALUES(2, 'you');
 
> CREATE FUNCTION test_func() RETURNS SETOF record AS '
>      SELECT id, name FROM test;
> ' LANGUAGE SQL;

Or better, "RETURNS SETOF test", so you don't have to describe the
output record type every time you call it.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[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