Search Postgresql Archives

Re: Functions returning setof record -- can I use a table type as my return type hint?

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

 



On 08/12/2011 10:04 AM, George MacKerron wrote:
> Hi all.
>
> I have a function returning setof record. The name of a table it acts on is one of its input variables, and its output is a set of rows from that table. E.g. for simplicity, imagine it's this pointless function:
>
> create or replace function select_all_from(table_name text) 
> returns setof record as $$
> declare
> begin
>   return query execute 'select * from ' || quote_ident(table_name);
> end
> $$ language 'plpgsql' stable;
>
>
> Please access the attached hyperlink for an important electronic communications disclaimer: http://lse.ac.uk/emailDisclaimer
>
returns setof table-name


-- 
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