Re: Closing some 8.4 open items

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Closing some 8.4 open items
Дата
Msg-id 17908.1239462839@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Closing some 8.4 open items  (David Fetter <david@fetter.org>)
Ответы Re: Closing some 8.4 open items  (Sam Mason <sam@samason.me.uk>)
Re: Closing some 8.4 open items  (Dimitri Fontaine <dfontaine@hi-media.com>)
Список pgsql-hackers
David Fetter <david@fetter.org> writes:
> The "do nothing" solution is unacceptable because windowing functions
> behave in a way that's essentially different, from the user's
> perspective, from other functions including aggregates.

I don't like doing nothing either, but I disagree with your conclusion
that window functions are as different from regular ones as aggregates
are.  Aggregates cause a sea-change in the behavior of the query around
them; window functions do not.  The call syntax of window functions is
a bit odd (which is why \df needs to label them) but they still produce
one output value where a regular function would produce one output
value, and they don't have an impact on the semantics of the surrounding
query.

My own take on it is that actually I'd prefer one command for all of
these.  If I say "\df sum" it would be good if the output included the
sum() aggregates; the reason being that I might be wondering if I can
create a plain function named sum.  If I have to check not only \df and
\da but also \dw for conflicts, that's going to be a real PITA.  Also,
pity the poor newbie who is unclear on the distinctions between these
different function-looking animals, and is just trying to find some
documentation on rank().

If we were designing in a green field I think you could make a real
strong case for a single \df command with an output column "type" having
the alternatives regular, aggregate, window, and maybe trigger.
        regards, tom lane


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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: Closing some 8.4 open items
Следующее
От: Sam Mason
Дата:
Сообщение: Re: Unicode string literals versus the world