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

Tatsuo Ishii <ishii@postgresql.org>

From: Tatsuo Ishii <ishii@postgresql.org>
To: tgl@sss.pgh.pa.us
Cc: ojford@gmail.com, vik@postgresfriends.org, pgsql-hackers@postgresql.org, andrew@tao11.riddles.org.uk, david@fetter.org, krasiyan@gmail.com
Date: 2025-01-20T00:18:25Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix coding style with "else".

  2. Fix multi WinGetFuncArgInFrame/Partition calls with IGNORE NULLS.

  3. Fix Coverity issue reported in commit 2273fa32bce.

  4. Use ereport rather than elog in WinCheckAndInitializeNullTreatment.

  5. Avoid uninitialized-variable warnings from older compilers.

  6. Fix Coverity issues reported in commit 25a30bbd423.

  7. Improve EXPLAIN's display of window functions.

  8. Automatically generate node support functions

> Tatsuo Ishii <ishii@postgresql.org> writes:
>>> The latest version restricts it to lag, lead, first_value, last_value,
>>> and nth_value. We can extend it in a subsequent patch if there's
>>> demand?
> 
>> The restriction is required by the SQL standard. So I don't think we
>> need to extend to other window functions.
> 
> The SQL spec does not believe that user-defined window functions are a
> thing.  So its opinion on this point is useless.

Of course the standard does not mention anything about the user
defined window functions and the restriction is not apply to the user
defined window functions.

> I would think that
> IGNORE NULLS is potentially useful for user-defined window functions,
> and we should not be building anything that restricts the feature to
> specific functions.

So you want to allow to use IGNORE NULLS to other built-in window
functions?
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp