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

From: Erik Rijkers <er(at)xs4all(dot)nl>
To: Oliver Ford <ojford(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add RANGE with values and exclusions clauses to the Window Functions
Date: 2018-01-27 11:08:38
Message-ID: b244bc301d081cc7f2c6c840a7bce0fa@xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-01-27 11:49, Oliver Ford wrote:
> On Sat, Jan 27, 2018 at 7:40 AM, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
>> On 2018-01-27 00:35, Oliver Ford wrote:
>>>
>>> Attached patch implements an extensible version of the RANGE with
>>> values clause. It doesn't actually add any more type support than was
>>
>> [...]
>>>
>>> I've tested that the existing regression tests in previous versions
>>> still pass, and also added new tests for descending mode.
>>>
>>
>> Hi,
>>
>> Regression tests only succeed for assert-disabled compiles; they fail
>> when
>> assert-enabled:
>>
>> I used (Centos 6.9):
>
> Could you please try the attached version? It works for me with asserts
> enabled.
>

[0001-window-frame-v8.patch]

Yes, that fixed it, thanks.

> Problem seems to be with an existing Assert in catcache.c:1545:
>
> Assert(nkeys > 0 && nkeys < cache->cc_nkeys);
>
> The "<" needs to be "<=" (and is changed in the attached patch).
> AFAICT this was never a problem before purely because no code before
> this patch called SearchSysCacheList4, so they always called with
> fewer keys than the number available. But it's surely correct to
> assert that the number of keys supplied is less than or equal to, not
> less than, the number of keys in the cache.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2018-01-27 11:40:03 Re: Setting BLCKSZ 4kB
Previous Message Oliver Ford 2018-01-27 10:49:46 Re: Add RANGE with values and exclusions clauses to the Window Functions