mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
docs: clarify JSONB operator descriptions
No catalog bump as the catalog changes are for SQL operator comments. Backpatch through 9.5
This commit is contained in:
parent
7e2a18a916
commit
b852dc4cbd
@ -10333,32 +10333,36 @@ table2-mapping
|
|||||||
<row>
|
<row>
|
||||||
<entry><literal>@></literal></entry>
|
<entry><literal>@></literal></entry>
|
||||||
<entry><type>jsonb</type></entry>
|
<entry><type>jsonb</type></entry>
|
||||||
<entry>Does the left JSON value contain within it the right value?</entry>
|
<entry>Does the left JSON value contain the right JSON
|
||||||
|
path/value entries at the top level?</entry>
|
||||||
<entry><literal>'{"a":1, "b":2}'::jsonb @> '{"b":2}'::jsonb</literal></entry>
|
<entry><literal>'{"a":1, "b":2}'::jsonb @> '{"b":2}'::jsonb</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal><@</literal></entry>
|
<entry><literal><@</literal></entry>
|
||||||
<entry><type>jsonb</type></entry>
|
<entry><type>jsonb</type></entry>
|
||||||
<entry>Is the left JSON value contained within the right value?</entry>
|
<entry>Are the left JSON path/value entries contained at the top level within
|
||||||
|
the right JSON value?</entry>
|
||||||
<entry><literal>'{"b":2}'::jsonb <@ '{"a":1, "b":2}'::jsonb</literal></entry>
|
<entry><literal>'{"b":2}'::jsonb <@ '{"a":1, "b":2}'::jsonb</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>?</literal></entry>
|
<entry><literal>?</literal></entry>
|
||||||
<entry><type>text</type></entry>
|
<entry><type>text</type></entry>
|
||||||
<entry>Does the key/element <emphasis>string</emphasis> exist within
|
<entry>Does the <emphasis>string</emphasis> exist as a top-level
|
||||||
the JSON value?</entry>
|
key within the JSON value?</entry>
|
||||||
<entry><literal>'{"a":1, "b":2}'::jsonb ? 'b'</literal></entry>
|
<entry><literal>'{"a":1, "b":2}'::jsonb ? 'b'</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>?|</literal></entry>
|
<entry><literal>?|</literal></entry>
|
||||||
<entry><type>text[]</type></entry>
|
<entry><type>text[]</type></entry>
|
||||||
<entry>Do any of these key/element <emphasis>strings</emphasis> exist?</entry>
|
<entry>Do any of these array <emphasis>strings</emphasis>
|
||||||
|
exist as top-level keys?</entry>
|
||||||
<entry><literal>'{"a":1, "b":2, "c":3}'::jsonb ?| array['b', 'c']</literal></entry>
|
<entry><literal>'{"a":1, "b":2, "c":3}'::jsonb ?| array['b', 'c']</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>?&</literal></entry>
|
<entry><literal>?&</literal></entry>
|
||||||
<entry><type>text[]</type></entry>
|
<entry><type>text[]</type></entry>
|
||||||
<entry>Do all of these key/element <emphasis>strings</emphasis> exist?</entry>
|
<entry>Do all of these array <emphasis>strings</emphasis> exist
|
||||||
|
as top-level keys?</entry>
|
||||||
<entry><literal>'["a", "b"]'::jsonb ?& array['a', 'b']</literal></entry>
|
<entry><literal>'["a", "b"]'::jsonb ?& array['a', 'b']</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
|
@ -369,8 +369,9 @@ SELECT '"foo"'::jsonb ? 'foo';
|
|||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The default GIN operator class for <type>jsonb</> supports queries with
|
The default GIN operator class for <type>jsonb</> supports queries with
|
||||||
the <literal>@></>, <literal>?</>, <literal>?&</>
|
top-level key-exists operators <literal>?</>, <literal>?&</>
|
||||||
and <literal>?|</> operators.
|
and <literal>?|</> operators and path/value-exists operator
|
||||||
|
<literal>@></>.
|
||||||
(For details of the semantics that these operators
|
(For details of the semantics that these operators
|
||||||
implement, see <xref linkend="functions-jsonb-op-table">.)
|
implement, see <xref linkend="functions-jsonb-op-table">.)
|
||||||
An example of creating an index with this operator class is:
|
An example of creating an index with this operator class is:
|
||||||
|
@ -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 ));
|
DATA(insert OID = 3246 ( "@>" PGNSP PGUID b f f 3802 3802 16 3250 0 jsonb_contains contsel contjoinsel ));
|
||||||
DESCR("contains");
|
DESCR("contains");
|
||||||
DATA(insert OID = 3247 ( "?" PGNSP PGUID b f f 3802 25 16 0 0 jsonb_exists contsel contjoinsel ));
|
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 ));
|
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 ));
|
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 ));
|
DATA(insert OID = 3250 ( "<@" PGNSP PGUID b f f 3802 3802 16 3246 0 jsonb_contained contsel contjoinsel ));
|
||||||
DESCR("is contained by");
|
DESCR("is contained by");
|
||||||
DATA(insert OID = 3284 ( "||" PGNSP PGUID b f f 3802 3802 3802 0 0 jsonb_concat - - ));
|
DATA(insert OID = 3284 ( "||" PGNSP PGUID b f f 3802 3802 3802 0 0 jsonb_concat - - ));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user