FUNCTION taking a record; returning a record?

From: InterRob <rob(dot)marjot(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: FUNCTION taking a record; returning a record?
Date: 2009-09-25 20:50:13
Message-ID: 671e36b0909251350h560d44adm2ed13d7a47b19dba@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2009-09-25 21:13:31 Re: lazy vacuum and AccessExclusiveLock
Previous Message Sam Mason 2009-09-25 20:34:36 Re: generic modelling of data models; enforcing constraints dynamically...