Re: "parameterized views" or return-type-inferring SQL functions? - Mailing list pgsql-general

From Craig Ringer
Subject Re: "parameterized views" or return-type-inferring SQL functions?
Date
Msg-id 4C453965.4090105@postnewspapers.com.au
Whole thread Raw
In response to "parameterized views" or return-type-inferring SQL functions?  (Craig Ringer <craig@postnewspapers.com.au>)
List 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 by date:

Previous
From: Robot Tom
Date:
Subject: Re: transactions within stored procedures
Next
From: Andy Colson
Date:
Subject: Re: locating cities within a radius of another