Re: "parameterized views" or return-type-inferring SQL functions?

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: "parameterized views" or return-type-inferring SQL functions?
Дата
Msg-id 4C453965.4090105@postnewspapers.com.au
обсуждение исходный текст
Ответ на "parameterized views" or return-type-inferring SQL functions?  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-general
Oh, sorry for the reply-to-self, but I know I can write an SQL function
with an OUT parameter list to do this. Like creating a custom rowtype
for the job, though, this gets cumbersome if the column-list is long, or
changes to the input tables might ever result in a change to column-list
types, add columns, etc.

Being able to write:

CREATE OR REPLACE FUNCTION blah(IN DATE, OUT a.*, OUT b.*) AS $$
SELECT * FROM a, b;
$$ LANGUAGE 'sql'

.. would be somewhat helpful as another form of the ability to expand
rowtypes for use in declarations, but having to list all the OUT
parameters explicitly as I currently do is no better than using CREATE
TYPE to make a custom rowtype or listing all the colums at call-sites
for a RECORD returning function.

--
Craig Ringer

Tech-related writing: http://soapyfrogs.blogspot.com/

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

В списке pgsql-general по дате отправления:

Предыдущее
От: Robot Tom
Дата:
Сообщение: Re: transactions within stored procedures
Следующее
От: Andy Colson
Дата:
Сообщение: Re: locating cities within a radius of another