From e632d9e9261b4983393828b09d079a950f9b68ca Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Wed, 24 Sep 2025 14:15:19 +0900 Subject: [PATCH v19 5/6] Modify documents to add null treatment clause. --- doc/src/sgml/func/func-window.sgml | 38 ++++++++++++++++++------------ 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/doc/src/sgml/func/func-window.sgml b/doc/src/sgml/func/func-window.sgml index cce0165b952..bcf755c9ebc 100644 --- a/doc/src/sgml/func/func-window.sgml +++ b/doc/src/sgml/func/func-window.sgml @@ -140,7 +140,7 @@ lag ( value anycompatible , offset integer - , default anycompatible ) + , default anycompatible ) null treatment anycompatible @@ -165,7 +165,7 @@ lead ( value anycompatible , offset integer - , default anycompatible ) + , default anycompatible ) null treatment anycompatible @@ -188,7 +188,7 @@ first_value - first_value ( value anyelement ) + first_value ( value anyelement ) null treatment anyelement @@ -202,7 +202,7 @@ last_value - last_value ( value anyelement ) + last_value ( value anyelement ) null treatment anyelement @@ -216,7 +216,7 @@ nth_value - nth_value ( value anyelement, n integer ) + nth_value ( value anyelement, n integer ) null treatment anyelement @@ -265,18 +265,26 @@ Other frame specifications can be used to obtain other effects. + + The null treatment option must be one of: + + RESPECT NULLS + IGNORE NULLS + + If unspecified, the default is RESPECT NULLS which includes NULL + values in any result calculation. IGNORE NULLS ignores NULL values. + This option is only allowed for the following functions: lag, + lead, first_value, last_value, + nth_value. + + - The SQL standard defines a RESPECT NULLS or - IGNORE NULLS option for lead, lag, - first_value, last_value, and - nth_value. This is not implemented in - PostgreSQL: the behavior is always the - same as the standard's default, namely RESPECT NULLS. - Likewise, the standard's FROM FIRST or FROM LAST - option for nth_value is not implemented: only the - default FROM FIRST behavior is supported. (You can achieve - the result of FROM LAST by reversing the ORDER BY + The SQL standard defines a FROM FIRST or FROM LAST + option for nth_value. This is not implemented in + PostgreSQL: only the default FROM FIRST + behavior is supported. (You can achieve the result of FROM LAST by + reversing the ORDER BY ordering.) -- 2.43.0