Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

From: Oliver Ford <ojford(at)gmail(dot)com>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, vik(at)postgresfriends(dot)org, pgsql-hackers(at)postgresql(dot)org, andrew(at)tao11(dot)riddles(dot)org(dot)uk, david(at)fetter(dot)org, krasiyan(at)gmail(dot)com
Subject: Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options
Date: 2025-01-21 21:14:55
Message-ID: CAGMVOdsmC47TTbmryHNH3wF7hhXioScCFLqRt95pjFbD4r=BPg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 21, 2025 at 1:21 AM Tatsuo Ishii <ishii(at)postgresql(dot)org> wrote:
> It needs lots of work including modifying CREATE FUNCTION
> command. Instead you could add an API to WinObject access functions to
> export ignore_nulls value. Then let each window function check it. If
> the window function should not take IGNORE/RESPECT NULLS option, throw
> an error.

Attached version moves the setting of IGNORE_NULLS to the window
function itself, with the functions that don't allow it erroring out.
This is done with a new api: WinCheckAndInitializeNullTreatment.

Custom functions that don't call this will simply not have the
IGNORE_NULLS option set as this api initializes the option and the
array. As per the previous discussion, it should have correct
formatting and handle the Exclusion clauses correctly.

Attachment Content-Type Size
0004-ignore-nulls.patch application/octet-stream 46.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sami Imseih 2025-01-21 21:22:08 Re: pg_stat_statements: improve loading and saving routines for the dump file
Previous Message Joe Conway 2025-01-21 21:13:26 Re: Replace current implementations in crypt() and gen_salt() to OpenSSL