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 4139.1515567978@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add RANGE with values and exclusions clauses to the Window Functions  (Oliver Ford <ojford@gmail.com>)
Responses Re: Add RANGE with values and exclusions clauses to the Window Functions
List pgsql-hackers
Oliver Ford <ojford@gmail.com> writes:
> On Tuesday, 9 January 2018, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> So the approach I'm imagining now is a datatype-specific support function
>> along the lines of
>>     in_range(a, b, delta) returns bool
>> Likely there are two of these, one each for the PRECEDING and FOLLOWING
>> cases.

> Would you prefer two functions, or a single function with a parameter for
> PRECEDING/FOLLOWING? Maybe:
>   in_range(a, b, delta, following) returns bool

You could do it that way too.  The two-function approach seems a little
cleaner and easier to document IMO, but it would create more catalog
bloat, so there's that.  I don't have a strong preference.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Oliver Ford
Date:
Subject: Re: Add RANGE with values and exclusions clauses to the Window Functions
Next
From: Aleksandr Parfenov
Date:
Subject: Re: [HACKERS] Flexible configuration for full-text search