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

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Functions returning setof record -- can I use a table type as my return type hint?
Date: 2011-08-12 16:44:14
Message-ID: 4E45585E.9090606@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message George MacKerron 2011-08-12 17:01:23 Re: Functions returning setof record -- can I use a table type as my return type hint?
Previous Message Raymond O'Donnell 2011-08-12 16:44:00 Re: Functions returning setof record -- can I use a table type as my return type hint?