diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-06-29 13:50:58 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-06-29 13:50:58 -0400 |
commit | a749a23d7af4dba9b3468076ec561d2cbf69af09 (patch) | |
tree | a2e0ebac0a075c5004156a2ca5b96272f0827ae6 /doc/src | |
parent | 51adcaa0df81da5e94b582d47de64ebb17129937 (diff) | |
download | postgresql-a749a23d7af4dba9b3468076ec561d2cbf69af09.tar.gz postgresql-a749a23d7af4dba9b3468076ec561d2cbf69af09.zip |
Remove use_json_as_text options from json_to_record/json_populate_record.
The "false" case was really quite useless since all it did was to throw
an error; a definition not helped in the least by making it the default.
Instead let's just have the "true" case, which emits nested objects and
arrays in JSON syntax. We might later want to provide the ability to
emit sub-objects in Postgres record or array syntax, but we'd be best off
to drive that off a check of the target field datatype, not a separate
argument.
For the functions newly added in 9.4, we can just remove the flag arguments
outright. We can't do that for json_populate_record[set], which already
existed in 9.3, but we can ignore the argument and always behave as if it
were "true". It helps that the flag arguments were optional and not
documented in any useful fashion anyway.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 551576a08b6..cd2465e41c7 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -10562,8 +10562,8 @@ table2-mapping </entry> </row> <row> - <entry><para><literal>json_populate_record(base anyelement, from_json json, [, use_json_as_text bool=false])</literal> - </para><para><literal>jsonb_populate_record(base anyelement, from_json jsonb, [, use_json_as_text bool=false])</literal> + <entry><para><literal>json_populate_record(base anyelement, from_json json)</literal> + </para><para><literal>jsonb_populate_record(base anyelement, from_json jsonb)</literal> </para></entry> <entry><type>anyelement</type></entry> <entry> @@ -10581,8 +10581,8 @@ table2-mapping </entry> </row> <row> - <entry><para><literal>json_populate_recordset(base anyelement, from_json json, [, use_json_as_text bool=false])</literal> - </para><para><literal>jsonb_populate_recordset(base anyelement, from_json jsonb, [, use_json_as_text bool=false])</literal> + <entry><para><literal>json_populate_recordset(base anyelement, from_json json)</literal> + </para><para><literal>jsonb_populate_recordset(base anyelement, from_json jsonb)</literal> </para></entry> <entry><type>setof anyelement</type></entry> <entry> @@ -10655,18 +10655,17 @@ table2-mapping <entry><literal>number</literal></entry> </row> <row> - <entry><para><literal>json_to_record(json [, nested_as_text bool=false])</literal> - </para><para><literal>jsonb_to_record(jsonb [, nested_as_text bool=false])</literal> + <entry><para><literal>json_to_record(json)</literal> + </para><para><literal>jsonb_to_record(jsonb)</literal> </para></entry> <entry><type>record</type></entry> <entry> Builds an arbitrary record from a JSON object (see note below). As with all functions returning <type>record</>, the caller must explicitly define the structure of the record with an <literal>AS</> - clause. If <replaceable>nested_as_text</> is true, the function - coerces nested complex elements to text. + clause. </entry> - <entry><literal>select * from json_to_record('{"a":1,"b":[1,2,3],"c":"bar"}',true) as x(a int, b text, d text) </literal></entry> + <entry><literal>select * from json_to_record('{"a":1,"b":[1,2,3],"c":"bar"}') as x(a int, b text, d text) </literal></entry> <entry> <programlisting> a | b | d @@ -10676,18 +10675,17 @@ table2-mapping </entry> </row> <row> - <entry><para><literal>json_to_recordset(json [, nested_as_text bool=false])</literal> - </para><para><literal>jsonb_to_recordset(jsonb [, nested_as_text bool=false])</literal> + <entry><para><literal>json_to_recordset(json)</literal> + </para><para><literal>jsonb_to_recordset(jsonb)</literal> </para></entry> <entry><type>setof record</type></entry> <entry> Builds an arbitrary set of records from a JSON array of objects (see note below). As with all functions returning <type>record</>, the caller must explicitly define the structure of the record with - an <literal>AS</> clause. <replaceable>nested_as_text</> works as - with <function>json_to_record</>. + an <literal>AS</> clause. </entry> - <entry><literal>select * from json_to_recordset('[{"a":1,"b":"foo"},{"a":"2","c":"bar"}]',true) as x(a int, b text);</literal></entry> + <entry><literal>select * from json_to_recordset('[{"a":1,"b":"foo"},{"a":"2","c":"bar"}]') as x(a int, b text);</literal></entry> <entry> <programlisting> a | b |