From: | Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp> |
---|---|
To: | vik(at)postgresfriends(dot)org |
Cc: | tgl(at)sss(dot)pgh(dot)pa(dot)us, andrew(at)tao11(dot)riddles(dot)org(dot)uk, pgsql-hackers(at)postgresql(dot)org, david(at)fetter(dot)org, ojford(at)gmail(dot)com, krasiyan(at)gmail(dot)com |
Subject: | Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options |
Date: | 2023-04-23 01:24:02 |
Message-ID: | 20230423.102402.743583683068223745.t-ishii@sranhm.sra.co.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> Excellent. I was thinking about picking my version of this patch up
> again, but I think this might be better than mine.
Thanks.
> I am curious why set_mark is false in the IGNORE version instead of
> also being const_offset. Surely the nth non-null in the frame will
> never go backwards.
Initially I thought that too. But when I used const_offset instead of
false. I got an error:
ERROR: cannot fetch row before WindowObject's mark position
> I do agree that we can have <null treatment> without <from first or
> last> so let's move forward with this and handle the latter later.
Agreed.
>> Currently in the patch only nth_value is allowed to use RESPECT/IGNORE
>> NULLS.
>
> This should not be hard coded. It should be a new field in pg_proc
> (with a sanity check that it is only true for window functions). That
> way custom window functions can implement it.
There were some discussions on this in the past.
https://www.postgresql.org/message-id/flat/CAGMVOdsbtRwE_4%2Bv8zjH1d9xfovDeQAGLkP_B6k69_VoFEgX-A%40mail.gmail.com
It seems Tom and Andrew thought that "1.1.2. Change the behavior of
the windowapi in some consistent way" is ambitious. If we follow this
direction, I think each window function should check WindowFunc struct
passed by WinGetWindowFunc (added in my patch) to check whether IGNORE
NULLS can be applied or not in the function. If not, error out. This
way, we don't need to add a new field to pg_proc.
>> No document nor test patches are included for now.
>
> I can volunteer to work on these if you want.
Thanks! I think you can work on top of the last patch posted by Krasiyan Andreev:
https://www.postgresql.org/message-id/CAN1PwonAnC-KkRyY%2BDtRmxQ8rjdJw%2BgcOsHruLr6EnF7zSMH%3DQ%40mail.gmail.com
Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
From | Date | Subject | |
---|---|---|---|
Next Message | Tatsuo Ishii | 2023-04-23 03:29:24 | Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options |
Previous Message | Thomas Munro | 2023-04-23 01:09:14 | Bufferless buffered files |