Re: Create function problem - Mailing list pgsql-general

From gustavo halperin
Subject Re: Create function problem
Date
Msg-id 44D37744.3040301@gmail.com
Whole thread Raw
In response to Re: Create function problem  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
Michael Fuhr wrote:
> On Fri, Aug 04, 2006 at 06:44:16PM +0300, gustavo halperin wrote:
>
>> Michael Fuhr wrote:
>>
>>> Since the function has OUT parameters you can use "RETURNS SETOF record"
>>> like this:
>>>
>>> CREATE FUNCTION funcname(<params>) RETURNS SETOF record AS $$
>>> <body>
>>> $$ LANGUAGE SQL
>>>
>> What do you mean with the word "record", can you give an example of how
>> this "record" looks for two columns ?
>>
>
> "record" means the literal word "record".  Example:
>
> CREATE FUNCTION show_tables(OUT schema_name text, OUT table_name text)
> RETURNS SETOF record AS $$
>   SELECT table_schema, table_name
>   FROM information_schema.tables;
> $$ LANGUAGE sql;
>
> SELECT * FROM show_tables()
Thank you, IS WORK, Thank you very much for your help.
         Gustavo

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Create function problem
Next
From: Christian Kastner
Date:
Subject: Re: pg_xlog not cleaned up