Re: Add RANGE with values and exclusions clauses to the Window Functions - Mailing list pgsql-hackers

From Oliver Ford
Subject Re: Add RANGE with values and exclusions clauses to the Window Functions
Date
Msg-id CAGMVOdttRSUU3=tjgdhr902HmUVL1GLQWG0ZTVXi7OY59Xo0Xw@mail.gmail.com
Whole thread Raw
In response to Re: Add RANGE with values and exclusions clauses to the WindowFunctions  (Erik Rijkers <er@xs4all.nl>)
Responses Re: Add RANGE with values and exclusions clauses to the Window Functions
List pgsql-hackers
On Tue, Dec 5, 2017 at 11:12 PM, Erik Rijkers <er@xs4all.nl> wrote:
> On 2017-11-27 17:55, Oliver Ford wrote:
>>
>> Cheers here's v4 with the correct docs.
>
>
> This email just to link related thread  "Add GROUPS option to the Window
> Functions":
>
> https://www.postgresql.org/message-id/CAGMVOdtWkb9X7dUh7vjaCaiH34UGFg88unXYTEOub0Rk0swSXw%40mail.gmail.com
>
>
>
>

After further testing I found that some functions were returning
incorrect values with the new options. The attached patch calculates
the frame head and tail correctly, and in RANGE mode checks for the
sort key being null. The rule I've followed is that a null is out of
range of any other value, including another null.

I've merged the RANGE and GROUPS patches into one as these fixes touch
similar bits of code. So the attached patch will give full window
frame clause support.

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Observations in Parallel Append
Next
From: Alvaro Herrera
Date:
Subject: Re: WIP: a way forward on bootstrap data