Re: SQL: table function support

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: SQL: table function support
Дата
Msg-id 162867790806100239j15f2bd39hf25269d54064971a@mail.gmail.com
обсуждение исходный текст
Ответ на Re: SQL: table function support  (Neil Conway <neilc@samurai.com>)
Ответы Re: SQL: table function support
Список pgsql-patches
2008/6/10 Neil Conway <neilc@samurai.com>:
> On Tue, 2008-06-10 at 06:42 +0200, Pavel Stehule wrote:
>> internally is table functions implemenation identical with SRF.
>
> It's not the internals that I'm concerned about.
>
>> Semantically is far - user's doesn't specify return type (what is from
>> PostgreSQL), but specifies return table, what is more natural. What
>> more - for users is transparent chaotic joice betwen "SETOF RECORD"
>> for multicolumns sets and "SETOF type".
>
> Well, I'd just like to see some thought about how this *entire* feature
> ought to work, rather than just adding new knobs and syntax variants
> incrementally and seemingly at random. Just because it happens to be in
> the standard isn't really a compelling reason to make an overly-complex
> part of the system even more complicated, IMHO...
>
> -Neil
>

This feature has only little sense with plpgsql, but together with
sql's functions allows more readable code. And is significant for
SQL/PSM.

what is more logical and consistent?

create or replace function fx(a integer, out b integer, out c integer)
returns setof record as $$
select a, b
  from foo
 where a = $1;
$$ language sql;

or

create or replace function fx(a integer)
returns table(b integer, c integer) as $$
select a, b
  from foo
 where a = $1;
$$ language sql;


Pavel

>
>

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

Предыдущее
От: "Heikki Linnakangas"
Дата:
Сообщение: Re: \timing on/off
Следующее
От: Teodor Sigaev
Дата:
Сообщение: Re: GIN improvements