Re: BUG #12228: Primary use-case of PERCENT_RANK not supported

From: Jonathon Lachlan-Haché <jonlachlan(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #12228: Primary use-case of PERCENT_RANK not supported
Date: 2014-12-15 21:28:14
Message-ID: CAGzkcODnfFzD2gGSH-b91d3BVzsZt8=5awKU4kbwPdRqDfGD+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Yes, you are right that I just needed the basic window function. I must
have been confused because I was using percentile_disc() and assumed I
would be using the same WITHIN GROUP syntax.

I was not clear before about the hypothetical set functions and their
purpose. I have looked at the documentation at
http://www.postgresql.org/docs/9.4/static/functions-aggregate.html and now
see the difference.

Might it be worthwhile to include a suggestion in the error message and/or
documentation "Use of percent_rank() WITHIN GROUP is a hypothetical-set
aggregate function. If you do not intend to use a hypothetical-set
aggregate function, try using a window function with PARTITION BY instead
of WITHIN GROUP"? Not sure if that aligns with your style guidelines, but
just a thought.

Thanks so much for your previous response,
Jon

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-12-16 01:15:38 Re: BUG #12242: No error - if there is no comma seperator
Previous Message Andrew Sackville-West 2014-12-15 20:06:40 Re: regression, deadlock in high frequency single-row UPDATE