Re: Add RANGE with values and exclusions clauses to the Window Functions

From: Oliver Ford <ojford(at)gmail(dot)com>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add RANGE with values and exclusions clauses to the Window Functions
Date: 2017-12-22 14:28:52
Message-ID: CAGMVOdttRSUU3=tjgdhr902HmUVL1GLQWG0ZTVXi7OY59Xo0Xw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 5, 2017 at 11:12 PM, Erik Rijkers <er(at)xs4all(dot)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 Content-Type Size
0001-window-frame-v6.patch application/octet-stream 137.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2017-12-22 14:31:54 Re: WIP: a way forward on bootstrap data
Previous Message Amit Kapila 2017-12-22 14:18:08 Observations in Parallel Append