Re: Re: Functions returning sets

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Re: Functions returning sets
Дата
Msg-id 01ae01c0e0bc$c7f94710$0205a8c0@jecw2k1
обсуждение исходный текст
Ответ на RE: Re: Functions returning sets  (Mike Mascari <mascarm@mascari.com>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Don Baccus
Дата:
Сообщение: Re: Functions returning sets
Следующее
От: bpalmer
Дата:
Сообщение: cvs snapshot compile problems