Re: BUG #12228: Primary use-case of PERCENT_RANK not supported - Mailing list pgsql-bugs

From Jonathon Lachlan-Haché
Subject Re: BUG #12228: Primary use-case of PERCENT_RANK not supported
Date
Msg-id CAGzkcODnfFzD2gGSH-b91d3BVzsZt8=5awKU4kbwPdRqDfGD+w@mail.gmail.com
Whole thread
In response to Re: BUG #12228: Primary use-case of PERCENT_RANK not supported  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-bugs by date:

Previous
From: omkar1103@gmail.com
Date:
Subject: BUG #12242: No error - if there is no comma seperator
Next
From: aleks.dark@inbox.ru
Date:
Subject: BUG #12241: uninitialized value $lib_path