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

From Tom Lane
Subject Re: Add RANGE with values and exclusions clauses to the Window Functions
Date
Msg-id 26389.1517981284@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add RANGE with values and exclusions clauses to the Window Functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I wrote:
> [ 0001-window-frame-v14.patch ]

Pushed after further hacking on the documentation and test cases.
I went ahead with the "value" to "offset" terminology change, too.

You mentioned upthread that you were interested in adding more in_range
support functions.  I think it'd be a great idea to get that done for v11,
because according to my reading of the SQL spec, it expects "RANGE offset
PRECEDING/FOLLOWING" to work for any numeric type.  See SQL:2011 7.11
<window clause> syntax rule 11-a-iii:

    iii) The declared type of [the sort column] shall be numeric,
    datetime, or interval. The declared type of [the offset] shall be
    numeric if the declared type of SK is numeric; otherwise, it shall
    be an interval type that ...

So we need in_range functions for float4, float8, and numeric if we
really want to claim with a straight face that we cover all of SQL:2011
here.  I think that ought to be a small enough addition to deal with in
the final v11 commitfest, if you have time to prepare a patch this
month.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Shay Rojansky
Date:
Subject: Cached/global query plans, autopreparation
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] proposal: schema variables