> I see Tom Lane implemented the SQL92 feature of using subselects in
> FROM clauses:
>
> CREATE TABLE foo (
> key integer not null,
> value text);
>
> SELECT * FROM (SELECT * FROM foo) AS bar
> WHERE bar.key = 1;
>
> Perhaps this is how functions returning sets should operate:
>
> SELECT titles.* FROM titles, (SELECT funct_set('blah blah')) AS bar
> WHERE titles.title = bar.title;
>
This is exactly what I was thinking. To take it one step further, then you
could define a view as:
CREATE VIEW vw_funct_set as (SELECT funct_set('blah blah'));
Then the statement above might look like:
SELECT titles.* FROM titles, vw_funct_set AS bar WHERE titles.title =
bar.title;
IMHO this seems the most natural way to do what you have proposed.
-- Joe