Re: Implement for window functions - Mailing list pgsql-hackers

From Vik Fearing
Subject Re: Implement for window functions
Date
Msg-id 239b0840-9ade-a4cf-86a0-7fb3e58a564b@postgresfriends.org
Whole thread Raw
In response to Re: Implement for window functions  (Zhihong Yu <zyu@yugabyte.com>)
Responses Re: Implement for window functions  (Krasiyan Andreev <krasiyan@gmail.com>)
List pgsql-hackers
On 1/1/21 10:21 PM, Zhihong Yu wrote:
> Krasiyan:
> Happy New Year.
> 
> For WinGetFuncArgInPartition():
> 
> +           if (target > 0)
> +               step = 1;
> +           else if (target < 0)
> +               step = -1;
> +           else
> +               step = 0;
> 
> When would the last else statement execute ? Since the above code is
> for WINDOW_SEEK_CURRENT, I wonder why step should be 0.

Hi.

"lag(expr, 0) over w" is useless but valid.
-- 
Vik Fearing



pgsql-hackers by date:

Previous
From: Tatsuro Yamada
Date:
Subject: Re: list of extended statistics on psql
Next
From: Stephen Frost
Date:
Subject: Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)