From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | David Fetter <david(at)fetter(dot)org> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>, Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Closing some 8.4 open items |
Date: | 2009-04-11 15:13:59 |
Message-ID: | 17908.1239462839@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
David Fetter <david(at)fetter(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Sam Mason | 2009-04-11 15:20:47 | Re: Unicode string literals versus the world |
Previous Message | David Fetter | 2009-04-11 14:39:24 | Re: Closing some 8.4 open items |