|
hstore_to_json(hstore)hstore_to_json
json
- get hstore as a json value
+ get hstore as a json value, converting
+ all non-null values to JSON strings
hstore_to_json('"a key"=>1, b=>t, c=>null, d=>12345, e=>012345, f=>1.234, g=>2.345e+4')
{"a key": "1", "b": "t", "c": null, "d": "12345", "e": "012345", "f": "1.234", "g": "2.345e+4"}
+ |
+
hstore_to_jsonb(hstore)hstore_to_jsonb
+ jsonb
+ get hstore as a jsonb value, converting
+ all non-null values to JSON strings
+ hstore_to_jsonb('"a key"=>1, b=>t, c=>null, d=>12345, e=>012345, f=>1.234, g=>2.345e+4')
+ {"a key": "1", "b": "t", "c": null, "d": "12345", "e": "012345", "f": "1.234", "g": "2.345e+4"}
+
+
|
hstore_to_json_loose(hstore)hstore_to_json_loose
json
{"a key": 1, "b": true, "c": null, "d": 12345, "e": "012345", "f": 1.234, "g": 2.345e+4}
+ |
+
hstore_to_jsonb_loose(hstore)hstore_to_jsonb_loose
+ jsonb
+ get hstore as a jsonb value, but attempt to distinguish numerical and Boolean values so they are unquoted in the JSON
+ hstore_to_jsonb_loose('"a key"=>1, b=>t, c=>null, d=>12345, e=>012345, f=>1.234, g=>2.345e+4')
+ {"a key": 1, "b": true, "c": null, "d": 12345, "e": "012345", "f": 1.234, "g": 2.345e+4}
+
+
|
slice(hstore, text[])slice
hstore
- The function hstore_to_json is used when an hstore
- value is cast to json.
+ The function hstore_to_json is used when
+ an hstore value is cast to json.
+ Likewise, hstore_to_jsonb is used when
+ an hstore value is cast to jsonb.