docs: clarify JSONB operator descriptions
authorBruce Momjian
Wed, 7 Oct 2015 13:06:49 +0000 (09:06 -0400)
committerBruce Momjian
Wed, 7 Oct 2015 13:06:49 +0000 (09:06 -0400)
No catalog bump as the catalog changes are for SQL operator comments.

Backpatch through 9.5

doc/src/sgml/func.sgml
doc/src/sgml/json.sgml
src/include/catalog/pg_operator.h

index 262f5eea9fb14ea457b0a6a5e43a3193d9d03fb9..11bd6ea0f1b5928a2e802d208a5fbd29cbbae372 100644 (file)
@@ -10331,32 +10331,36 @@ table2-mapping
        
         @>
         jsonb
-        Does the left JSON value contain within it the right value?
+        Does the left JSON value contain the right JSON
+        path/value entries at the top level?
         '{"a":1, "b":2}'::jsonb @> '{"b":2}'::jsonb
        
        
         <@
         jsonb
-        Is the left JSON value contained within the right value?
+        Are the left JSON path/value entries contained at the top level within
+        the right JSON value?
         '{"b":2}'::jsonb <@ '{"a":1, "b":2}'::jsonb
        
        
         ?
         text
-        Does the key/element string exist within
-        the JSON value?
+        Does the string exist as a top-level
+        key within the JSON value?
         '{"a":1, "b":2}'::jsonb ? 'b'
        
        
         ?|
         text[]
-        Do any of these key/element strings exist?
+        Do any of these array strings
+        exist as top-level keys?
         '{"a":1, "b":2, "c":3}'::jsonb ?| array['b', 'c']
        
        
         ?&
         text[]
-        Do all of these key/element strings exist?
+        Do all of these array strings exist
+        as top-level keys?
         '["a", "b"]'::jsonb ?& array['a', 'b']
        
        
index 1e78558e27ac390a5669ba682996ab2035df0f20..b4b390b23eb150bf550f8d74f6bb90b9cf17a239 100644 (file)
@@ -369,8 +369,9 @@ SELECT '"foo"'::jsonb ? 'foo';
   
   
     The default GIN operator class for jsonb supports queries with
-    the @>, ?, ?&
-    and ?| operators.
+    top-level key-exists operators ?, ?&
+    and ?| operators and path/value-exists operator
+    @>.
     (For details of the semantics that these operators
     implement, see .)
     An example of creating an index with this operator class is:
index 26c9d4e4f7bd089a52b4c207af72de5920fd7a20..eec9c60c505a3ec8611872cf52fbff46bee3330b 100644 (file)
@@ -1806,11 +1806,11 @@ DESCR("greater than or equal");
 DATA(insert OID = 3246 (  "@>"    PGNSP PGUID b f f 3802 3802 16 3250 0 jsonb_contains contsel contjoinsel ));
 DESCR("contains");
 DATA(insert OID = 3247 (  "?"     PGNSP PGUID b f f 3802 25 16 0 0 jsonb_exists contsel contjoinsel ));
-DESCR("exists");
+DESCR("key exists");
 DATA(insert OID = 3248 (  "?|"    PGNSP PGUID b f f 3802 1009 16 0 0 jsonb_exists_any contsel contjoinsel ));
-DESCR("exists any");
+DESCR("any key exists");
 DATA(insert OID = 3249 (  "?&"    PGNSP PGUID b f f 3802 1009 16 0 0 jsonb_exists_all contsel contjoinsel ));
-DESCR("exists all");
+DESCR("all keys exist");
 DATA(insert OID = 3250 (  "<@"    PGNSP PGUID b f f 3802 3802 16 3246 0 jsonb_contained contsel contjoinsel ));
 DESCR("is contained by");
 DATA(insert OID = 3284 (  "||"    PGNSP PGUID b f f 3802 3802 3802 0 0 jsonb_concat - - ));