mirror of
https://github.com/postgres/postgres.git
synced 2025-06-05 23:56:58 +03:00
Add hstore_to_jsonb() and hstore_to_jsonb_loose() to hstore documentation.
These were never documented anywhere user-visible. Tut tut.
This commit is contained in:
parent
c33d1a8d52
commit
c27fda69c9
@ -325,11 +325,21 @@ b
|
|||||||
<row>
|
<row>
|
||||||
<entry><function>hstore_to_json(hstore)</function><indexterm><primary>hstore_to_json</primary></indexterm></entry>
|
<entry><function>hstore_to_json(hstore)</function><indexterm><primary>hstore_to_json</primary></indexterm></entry>
|
||||||
<entry><type>json</type></entry>
|
<entry><type>json</type></entry>
|
||||||
<entry>get <type>hstore</type> as a <type>json</type> value</entry>
|
<entry>get <type>hstore</type> as a <type>json</type> value, converting
|
||||||
|
all non-null values to JSON strings</entry>
|
||||||
<entry><literal>hstore_to_json('"a key"=>1, b=>t, c=>null, d=>12345, e=>012345, f=>1.234, g=>2.345e+4')</literal></entry>
|
<entry><literal>hstore_to_json('"a key"=>1, b=>t, c=>null, d=>12345, e=>012345, f=>1.234, g=>2.345e+4')</literal></entry>
|
||||||
<entry><literal>{"a key": "1", "b": "t", "c": null, "d": "12345", "e": "012345", "f": "1.234", "g": "2.345e+4"}</literal></entry>
|
<entry><literal>{"a key": "1", "b": "t", "c": null, "d": "12345", "e": "012345", "f": "1.234", "g": "2.345e+4"}</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
|
<row>
|
||||||
|
<entry><function>hstore_to_jsonb(hstore)</function><indexterm><primary>hstore_to_jsonb</primary></indexterm></entry>
|
||||||
|
<entry><type>jsonb</type></entry>
|
||||||
|
<entry>get <type>hstore</type> as a <type>jsonb</type> value, converting
|
||||||
|
all non-null values to JSON strings</entry>
|
||||||
|
<entry><literal>hstore_to_jsonb('"a key"=>1, b=>t, c=>null, d=>12345, e=>012345, f=>1.234, g=>2.345e+4')</literal></entry>
|
||||||
|
<entry><literal>{"a key": "1", "b": "t", "c": null, "d": "12345", "e": "012345", "f": "1.234", "g": "2.345e+4"}</literal></entry>
|
||||||
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry><function>hstore_to_json_loose(hstore)</function><indexterm><primary>hstore_to_json_loose</primary></indexterm></entry>
|
<entry><function>hstore_to_json_loose(hstore)</function><indexterm><primary>hstore_to_json_loose</primary></indexterm></entry>
|
||||||
<entry><type>json</type></entry>
|
<entry><type>json</type></entry>
|
||||||
@ -338,6 +348,14 @@ b
|
|||||||
<entry><literal>{"a key": 1, "b": true, "c": null, "d": 12345, "e": "012345", "f": 1.234, "g": 2.345e+4}</literal></entry>
|
<entry><literal>{"a key": 1, "b": true, "c": null, "d": 12345, "e": "012345", "f": 1.234, "g": 2.345e+4}</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
|
<row>
|
||||||
|
<entry><function>hstore_to_jsonb_loose(hstore)</function><indexterm><primary>hstore_to_jsonb_loose</primary></indexterm></entry>
|
||||||
|
<entry><type>jsonb</type></entry>
|
||||||
|
<entry>get <type>hstore</type> as a <type>jsonb</type> value, but attempt to distinguish numerical and Boolean values so they are unquoted in the JSON</entry>
|
||||||
|
<entry><literal>hstore_to_jsonb_loose('"a key"=>1, b=>t, c=>null, d=>12345, e=>012345, f=>1.234, g=>2.345e+4')</literal></entry>
|
||||||
|
<entry><literal>{"a key": 1, "b": true, "c": null, "d": 12345, "e": "012345", "f": 1.234, "g": 2.345e+4}</literal></entry>
|
||||||
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry><function>slice(hstore, text[])</function><indexterm><primary>slice</primary></indexterm></entry>
|
<entry><function>slice(hstore, text[])</function><indexterm><primary>slice</primary></indexterm></entry>
|
||||||
<entry><type>hstore</type></entry>
|
<entry><type>hstore</type></entry>
|
||||||
@ -414,8 +432,10 @@ b
|
|||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
The function <function>hstore_to_json</function> is used when an <type>hstore</type>
|
The function <function>hstore_to_json</function> is used when
|
||||||
value is cast to <type>json</type>.
|
an <type>hstore</type> value is cast to <type>json</type>.
|
||||||
|
Likewise, <function>hstore_to_jsonb</function> is used when
|
||||||
|
an <type>hstore</type> value is cast to <type>jsonb</type>.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user