Add hstore_to_jsonb() and hstore_to_jsonb_loose() to hstore documentation.
authorTom Lane
Wed, 3 Feb 2016 17:56:40 +0000 (12:56 -0500)
committerTom Lane
Wed, 3 Feb 2016 17:57:13 +0000 (12:57 -0500)
These were never documented anywhere user-visible.  Tut tut.

doc/src/sgml/hstore.sgml

index 78cc8d5309629d547b2bbdc261bcd6a7ca09afe7..db5d4409a6e585cf58cca7677e50b9e21d9c5a72 100644 (file)
@@ -325,11 +325,21 @@ b
      
       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
@@ -338,6 +348,14 @@ b
       {"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
@@ -414,8 +432,10 @@ b
 
   
    
-     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.