Skip site navigation (1) Skip section navigation (2)

Re: wip: functions median and percentile

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Greg Stark <gsstark(at)mit(dot)edu>, David Fetter <david(at)fetter(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wip: functions median and percentile
Date: 2010-10-11 10:33:11
Message-ID: AANLkTimiWJqhc+=Ysy-NeAgL136xKg3ZxgU=ZvFy3U-q@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-rrreviewers
On 11 October 2010 10:55, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>> BTW, why has percentile been removed from this patch? As the more
>> general, and SQL standard function, that would seem to be the more
>> useful one to include. Upthread it was mentioned that there is already
>> an ntile window function, but actually that's a completely different
>> thing.
>
> The reason for removing was impossibility to specify so some parameter
> must by immutable - in this case p parameter should be immutable
> otherwise the result is undefined.
>

Could we not just make an arbitrary choice, like the last non-null
value, and then document that. I can't believe that this would ever be
an issue in practice.

I don't think there is any way to deduce the following from behaviour
from the documentation:

select string_agg(i::text, repeat(',',i)) from generate_series(1,10) as g(i);
                            string_agg
-------------------------------------------------------------------
 1,,2,,,3,,,,4,,,,,5,,,,,,6,,,,,,,7,,,,,,,,8,,,,,,,,,9,,,,,,,,,,10
(1 row)

but I don't see it as a real problem for the aggregate.

Thoughts?

Regards,
Dean

In response to

pgsql-hackers by date

Next:From: Robert HaasDate: 2010-10-11 10:33:12
Subject: Re: wip: functions median and percentile
Previous:From: Pierre CDate: 2010-10-11 10:09:02
Subject: Re: Slow count(*) again...

pgsql-rrreviewers by date

Next:From: Robert HaasDate: 2010-10-11 10:33:12
Subject: Re: wip: functions median and percentile
Previous:From: Pavel StehuleDate: 2010-10-11 09:55:16
Subject: Re: wip: functions median and percentile

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group