On Mon, Dec 01, 2003 at 09:38:06AM +1100, Alex Satrapa wrote:
> create or replace function get_transactions (INTEGER) returns set of
> record as '
> DECLARE
> cust_id ALIAS FOR $1;
> BEGIN
> for r in select ... from ... loop
> return next r;
> end loop;
> return;
> END
> ' language 'plpgsql';
>
> But I would certainly love to have parameterised views :)
Me too. I've created many functions to extract data that are joined to
other functions. All in all the result is not as optimal as it could
be, because the optimizer can not poke into the functions, and the
estimates about functions are only guesses. If one could use
parametrized views instead of functions the whole mess would probably be
more optimal.
Maybe there's a TODO here?
--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Ninguna manada de bestias tiene una voz tan horrible como la humana" (Orual)