Implement <null treatment> for window functions

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Implement <null treatment> for window functions
Date: 2020-06-30 13:54:16
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

This feature adds RESPECT NULLS and IGNORE NULLS syntax to several
window functions, according to the SQL Standard.

Unlike the last time this was attempted[1], my version does not hardcode
the spec's list of functions that this applies to. Instead, it accepts
it for all true window functions (that is, it does not apply to
aggregates acting as window functions).

This patch also does not attempt to solve the FROM LAST problem. That
remains unimplemented.

For the CREATE FUNCTION syntax, I used TREAT NULLS so as to avoid
creating new keywords.

The second patch adds some new window functions in order to test that
the null treatment works correctly for cases that aren't covered by the
standard functions but that custom functions might want to use. It is
*not* intended to be committed; I am only submitting the first patch for
inclusion in core.

This is based off of 324435eb14.

Vik Fearing

Attachment Content-Type Size
0001-implement-null-treatment-for-window-functions.patch text/x-patch 63.5 KB
0002-new-window-functions-to-aid-testing.patch text/x-patch 8.0 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-06-30 14:15:05 Re: warnings for invalid function casts
Previous Message Fujii Masao 2020-06-30 13:40:40 Re: track_planning causing performance regression