FUNCTION taking a record; returning a record?

Поиск
Список
Период
Сортировка
От InterRob
Тема FUNCTION taking a record; returning a record?
Дата
Msg-id 671e36b0909251350h560d44adm2ed13d7a47b19dba@mail.gmail.com
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Sam Mason
Дата:
Сообщение: Re: generic modelling of data models; enforcing constraints dynamically...
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: lazy vacuum and AccessExclusiveLock