Search Postgresql Archives

Re: returning dynamic record

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

 



Il Wednesday 07 November 2007 06:35:55 Tom Lane ha scritto:
> nick <nick@xxxxxxxxxxxxxxxxx> writes:
> > Just wondering, if it is possible to do the following
> > create function foo() RETURNS Record(int, varchar, int)
>
> OUT parameters (in reasonably recent PG releases).
>
> regression=# create function foo (f1 out int, f2 out varchar, f3 out int)
> as $$ select 42, 'foo'::varchar, 43 $$ language sql;
> CREATE FUNCTION
> regression=# select * from foo();
>  f1 | f2  | f3
> ----+-----+----
>  42 | foo | 43
> (1 row)
>
> 			regards, tom lane


Maybe

create function foo (f1 out int, f2 out varchar, f3 out int)
returns setof record as $body$ 
...


will return the set.


-- 
Reg me Please

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[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