Re: Impossible with pl/pgsql? - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: Impossible with pl/pgsql?
Date
Msg-id 20050530161332.GA78929@winnie.fuhr.org
Whole thread Raw
In response to Impossible with pl/pgsql?  (Markus Bertheau ☭ <twanger@bluetwanger.de>)
List pgsql-sql
On Mon, May 30, 2005 at 05:15:55PM +0200, Markus Bertheau ??? wrote:
> 
> Now how would a query look like that involves find() and decorate() and
> returns
> 
> id | name | author | last_change
> --------------------------------
>  4 | egg  | john   | 2003-05-05
>  5 | ham  | dave   | 2004-03-01

Either of the following should work in PostgreSQL 8.0 and later:

SELECT (decorate(x)).* FROM find() AS f(x);
SELECT (decorate(find)).* FROM find();

A downside is that decorate() will be called once for each output
column in each row, as can be seen by adding debugging RAISE
statements.  So in your example it would be called eight times
(2 rows * 4 columns) instead of twice (once for each of 2 rows).

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


pgsql-sql by date:

Previous
From: Markus Bertheau ☭
Date:
Subject: Impossible with pl/pgsql?
Next
From: Tom Lane
Date:
Subject: Re: Impossible with pl/pgsql?