diff options
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 567d2ecf3a8..3d3d9d91836 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -14058,14 +14058,14 @@ SELECT NULLIF(value, '(none)') ... <row> <entry> <literal>@></literal> </entry> <entry>contains</entry> - <entry><literal>ARRAY[1,4,3] @> ARRAY[3,1]</literal></entry> + <entry><literal>ARRAY[1,4,3] @> ARRAY[3,1,3]</literal></entry> <entry><literal>t</literal></entry> </row> <row> <entry> <literal><@</literal> </entry> <entry>is contained by</entry> - <entry><literal>ARRAY[2,7] <@ ARRAY[1,7,4,2,6]</literal></entry> + <entry><literal>ARRAY[2,2,7] <@ ARRAY[1,7,4,2,6]</literal></entry> <entry><literal>t</literal></entry> </row> @@ -14108,8 +14108,10 @@ SELECT NULLIF(value, '(none)') ... </table> <para> - Array comparisons compare the array contents element-by-element, - using the default B-tree comparison function for the element data type. + The array ordering operators (<literal><</literal>, + <literal>>=</literal>, etc) compare the array contents + element-by-element, using the default B-tree comparison function for + the element data type, and sort based on the first difference. In multidimensional arrays the elements are visited in row-major order (last subscript varies most rapidly). If the contents of two arrays are equal but the dimensionality is @@ -14121,6 +14123,15 @@ SELECT NULLIF(value, '(none)') ... </para> <para> + The array containment operators (<literal><@</literal> + and <literal>@></literal>) consider one array to be contained in + another one if each of its elements appears in the other one. + Duplicates are not treated specially, thus <literal>ARRAY[1]</literal> + and <literal>ARRAY[1,1]</literal> are each considered to contain the + other. + </para> + + <para> See <xref linkend="arrays"/> for more details about array operator behavior. See <xref linkend="indexes-types"/> for more details about which operators support indexed operations. @@ -18277,7 +18288,7 @@ SELECT has_function_privilege('joeuser', 'myfunc(int, text)', 'execute'); <row> <entry> <literal>@></literal> </entry> <entry>contains element</entry> - <entry><literal>'{calvin=r*w/hobbes,hobbes=r*w*/postgres}'::aclitem[] @> 'calvin=r*w/hobbes'::aclitem</literal></entry> + <entry><literal>'{calvin=r*w/hobbes,hobbes=r*w*/postgres}'::aclitem[] @> 'calvin=r*w/hobbes'::aclitem</literal></entry> <entry><literal>t</literal></entry> </row> |