@@ -10095,7 +10095,7 @@ table2-mapping
1009510095 </entry>
1009610096 <entry><type>json</type></entry>
1009710097 <entry>
10098- Returns JSONobject pointed to by <parameter>path_elems</parameter>.
10098+ Returns JSONvalue pointed to by <parameter>path_elems</parameter>.
1009910099 </entry>
1010010100 <entry><literal>json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"foo"}}','f4')</literal></entry>
1010110101 <entry><literal>{"f5":99,"f6":"foo"}</literal></entry>
@@ -10109,7 +10109,7 @@ table2-mapping
1010910109 </entry>
1011010110 <entry><type>text</type></entry>
1011110111 <entry>
10112- Returns JSONobject pointed to by <parameter>path_elems</parameter>.
10112+ Returns JSONvalue pointed to by <parameter>path_elems</parameter>.
1011310113 </entry>
1011410114 <entry><literal>json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"foo"}}','f4', 'f6')</literal></entry>
1011510115 <entry><literal>foo</literal></entry>
@@ -10192,7 +10192,7 @@ table2-mapping
1019210192 </entry>
1019310193 <entry><type>SETOF json</type></entry>
1019410194 <entry>
10195- Expands a JSON array to a set of JSONelements .
10195+ Expands a JSON array to a set of JSONvalues .
1019610196 </entry>
1019710197 <entry><literal>json_array_elements('[1,true, [2,false]]')</literal></entry>
1019810198 <entry>
@@ -10205,6 +10205,23 @@ table2-mapping
1020510205</programlisting>
1020610206 </entry>
1020710207 </row>
10208+ <row>
10209+ <entry>
10210+ <indexterm>
10211+ <primary>json_typeof</primary>
10212+ </indexterm>
10213+ <literal>json_typeof(json)</literal>
10214+ </entry>
10215+ <entry><type>text</type></entry>
10216+ <entry>
10217+ Returns the type of the outermost JSON value as a text string. The types are
10218+ <literal>object</>, <literal>array</>, <literal>string</>, <literal>number</>,
10219+ <literal>boolean</>, and <literal>null</>. (See note below regarding the
10220+ distinction between a JSON <literal>null</> and a SQL NULL.)
10221+ </entry>
10222+ <entry><literal>json_typeof('-123.4')</literal></entry>
10223+ <entry><literal>number</literal></entry>
10224+ </row>
1020810225 </tbody>
1020910226 </tgroup>
1021010227 </table>
@@ -10237,6 +10254,14 @@ table2-mapping
1023710254 </para>
1023810255 </note>
1023910256
10257+ <note>
10258+ <para>
10259+ The <literal>json_typeof</> function's <literal>null</> return value should not be confused
10260+ with a SQL NULL. While calling <literal>json_typeof('null'::json)</> will return <literal>null</>,
10261+ calling <literal>json_typeof(NULL::json)</> will return a SQL NULL.
10262+ </para>
10263+ </note>
10264+
1024010265 <para>
1024110266 See also <xref linkend="functions-aggregate"> about the aggregate
1024210267 function <function>json_agg</function> which aggregates record