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

Поиск
Список
Период
Сортировка
От Oliver Ford
Тема Re: Add RANGE with values and exclusions clauses to the Window Functions
Дата
Msg-id CAGMVOdtYSNJusckQ_9vBkMsZBQzan=Uw-Z-uYG2fD9rZ2TP7pA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add RANGE with values and exclusions clauses to the Window Functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Add RANGE with values and exclusions clauses to the Window Functions
Список pgsql-hackers


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

which is supposed to return true if a <= b + delta, or something along
that line --- exact details of the definition TBD --- with the proviso
that if b + delta would overflow then the result is automatically true.

We could probably also delegate the requirement of throwing an error
for negative delta to this function, eliminating the need for the
datatype-independent core code to know how to tell that, which is the
other datatype-dependent behavior needed per spec.

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

Where following is a bool which is true if FOLLOWING was specified and false if PRECEDING was specified?

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Oleg Bartunov
Дата:
Сообщение: Re: [HACKERS] SQL/JSON in PostgreSQL
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Add RANGE with values and exclusions clauses to the Window Functions