From 45b1b6f0795592d8a8161b4ca6c6cb60835ff55f Mon Sep 17 00:00:00 2001 From: "David G. Johnston" Date: Fri, 10 Jun 2022 00:23:39 +0000 Subject: [PATCH] doc: array_length produces null instead of 0 --- doc/src/sgml/func.sgml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 478a216dbb..56de03a6d3 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -15867,6 +15867,10 @@ table2-mapping json_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]') 5 + + + jsonb_array_length('[]') + 0 @@ -19238,10 +19242,19 @@ SELECT NULLIF(value, '(none)') ... Returns the length of the requested array dimension. + (Produces NULL instead of 0 for empty or missing array dimensions.) array_length(array[1,2,3], 1) 3 + + + array_length(array[], 1) + NULL + + + array_length(array['text'], 2) + NULL -- 2.25.1