From: | "Joe Conway" <joe(at)conway-family(dot)com> |
---|---|
To: | "'mlw'" <markw(at)mohawksoft(dot)com> |
Cc: | "Hackers List" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Re: Functions returning sets |
Date: | 2001-05-19 23:38:16 |
Message-ID: | 01ae01c0e0bc$c7f94710$0205a8c0@jecw2k1 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> 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
From | Date | Subject | |
---|---|---|---|
Next Message | bpalmer | 2001-05-20 00:03:50 | cvs snapshot compile problems |
Previous Message | Don Baccus | 2001-05-19 23:08:37 | Re: Functions returning sets |