Re: Support for RANGE ... PRECEDING windows in OVER

From: ian link <ian(at)ilink(dot)io>
To: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support for RANGE ... PRECEDING windows in OVER
Date: 2013-06-21 19:30:19
Message-ID: CAOOwM5Lz+3ikgJQDpaebMgrZHtby0fihCXQgtLHmFjczaciyJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Forgive my ignorance, but I don't entirely understand the problem. What
does '+' and '-' refer to exactly?
Thanks!

On Fri, Jun 21, 2013 at 4:35 AM, Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>wrote:

>
>
>
> On Fri, Jun 21, 2013 at 3:20 AM, Craig Ringer <craig(at)2ndquadrant(dot)com>wrote:
>
>> On 06/21/2013 05:32 PM, Hitoshi Harada wrote:
>>
>> > I also later found that we are missing not only notion of '+' or '-',
>> > but also notion of 'zero value' in our catalog. Per spec, RANGE BETWEEN
>> > needs to detect ERROR if the offset value is negative, but it is not
>> > always easy if you think about interval, numeric types as opposed to
>> > int64 used in ROWS BETWEEN.
>>
>> Zero can be tested for with `val = (@ val)` ie `val = abs(val)`. That
>> should make sense for any type in which the concept of zero makes sense.
>>
>>
>> Yeah, I mean, it needs to know if offset is negative or not by testing
> with zero. So we need "zero value" or "is_negative function" for each type.
>
> Thanks,
> --
> Hitoshi Harada
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2013-06-21 19:43:01 Re: GIN improvements part2: fast scan
Previous Message Mark Wong 2013-06-21 19:11:05 Re: Hardware donation