FUNCTION taking a record; returning a record? - Mailing list pgsql-general

From InterRob
Subject FUNCTION taking a record; returning a record?
Date
Msg-id 671e36b0909251350h560d44adm2ed13d7a47b19dba@mail.gmail.com
Whole thread Raw
List pgsql-general
Dear list,

I wrote a function that takes one parameter of a certain 'table type':

CREATE FUNCTION deserialize(serTable table1) RETURNS record AS ... 

I whish to use this function in a query such as:

SELECT deser.* FROM deserialize(table1) deser(col1 integer, col2 integer), table1 WHERE table1.field > [some_value]

Thus: have the function perform its operation on a SUBSET of table1, RETURNING multiple fields.

I can't quite figure out how to put this together (other than passing the table name and where-clause as TEXT)...

Any ideas? They are very much appreciated.

Regards,


Rob

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: generic modelling of data models; enforcing constraints dynamically...
Next
From: Alvaro Herrera
Date:
Subject: Re: lazy vacuum and AccessExclusiveLock