Polymorphic "setof record" function? - Mailing list pgsql-general

From Christian Schröder
Subject Polymorphic "setof record" function?
Date
Msg-id 496C9C39.40403@deriva.de
Whole thread Raw
Responses Re: Polymorphic "setof record" function?
Re: Polymorphic "setof record" function?
Re: Polymorphic "setof record" function?
List pgsql-general
Hi list,
I have written a function that returns a setof record. The function has
a table name as a parameter and the resulting records have the same
structure as this table. Is there any easy way to specify this when I
call the function? If the table has many columns then it's annoying to
specify all of them.
I need something like:
    select * from myfunc('mytable') as x(like mytable)
or
    select * from myfunc('mytable') as x(mytable%TYPE)

Is there any solution for PostgreSQL 8.2?

Regards,
    Christian

--
Deriva GmbH                         Tel.: +49 551 489500-42
Financial IT and Consulting         Fax:  +49 551 489500-91
Hans-Böckler-Straße 2                  http://www.deriva.de
D-37079 Göttingen

Deriva CA Certificate: http://www.deriva.de/deriva-ca.cer



pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [pgsql-advocacy] PgUS 2008 end of year summary
Next
From: Emanuel Calvo Franco
Date:
Subject: Re: Polymorphic "setof record" function?