I've been surprisingly unable to find an nth percentile function for postgresql.
I am using this via mondrian olap tool so i just need an aggregate function which returns a 95th percentile.
I did find this link:
http://www.postgresql.org/message-id/162867790907102334r71db0227jfa0e4bd96f48b8e4@mail.gmail.com
But for some reason the code in that percentile function is returning nulls in some cases with certain queries. I've checked the data and there's nothing odd in the data that would seem to cause that!