Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2373fe7

Browse files
committed
doc: add examples for array_length() and jsonb_array_length()
The examples show the output of array_length() and jsonb_array_length()for empty arrays.Discussion:https://postgr.es/m/CAKFQuwaoBmRuWdMLzLHDCFDJDX3wvfQ7egAF0bpik_BFgG1KWg@mail.gmail.comAuthor: David G. JohnstonBackpatch-through: 13
1 parentaa31b29 commit2373fe7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15867,6 +15867,10 @@ table2-mapping
1586715867
<para>
1586815868
<literal>json_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]')</literal>
1586915869
<returnvalue>5</returnvalue>
15870+
</para>
15871+
<para>
15872+
<literal>jsonb_array_length('[]')</literal>
15873+
<returnvalue>0</returnvalue>
1587015874
</para></entry>
1587115875
</row>
1587215876

@@ -19238,10 +19242,19 @@ SELECT NULLIF(value, '(none)') ...
1923819242
</para>
1923919243
<para>
1924019244
Returns the length of the requested array dimension.
19245+
(Produces NULL instead of 0 for empty or missing array dimensions.)
1924119246
</para>
1924219247
<para>
1924319248
<literal>array_length(array[1,2,3], 1)</literal>
1924419249
<returnvalue>3</returnvalue>
19250+
</para>
19251+
<para>
19252+
<literal>array_length(array[]::int[], 1)</literal>
19253+
<returnvalue>NULL</returnvalue>
19254+
</para>
19255+
<para>
19256+
<literal>array_length(array['text'], 2)</literal>
19257+
<returnvalue>NULL</returnvalue>
1924519258
</para></entry>
1924619259
</row>
1924719260

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp