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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tatsuo Ishii <ishii@postgresql.org>
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:03:29Z
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.  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.

			regards, tom lane