-<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.334 2006/09/05 21:08:33 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.335 2006/09/10 00:29:33 tgl Exp $ -->
<chapter id="functions">
<title>Functions and Operators</title>
<entry><literal>lseg '((-1,0),(1,0))' ?|| lseg '((-1,2),(1,2))'</literal></entry>
</row>
<row>
- <entry> <literal>~</literal> </entry>
+ <entry> <literal>@></literal> </entry>
<entry>Contains?</entry>
- <entry><literal>circle '((0,0),2)' ~ point '(1,1)'</literal></entry>
+ <entry><literal>circle '((0,0),2)' @> point '(1,1)'</literal></entry>
</row>
<row>
- <entry> <literal>@</literal> </entry>
+ <entry> <literal><@</literal> </entry>
<entry>Contained in or on?</entry>
- <entry><literal>point '(1,1)' @ circle '((0,0),2)'</literal></entry>
+ <entry><literal>point '(1,1)' <@ circle '((0,0),2)'</literal></entry>
</row>
<row>
<entry> <literal>~=</literal> </entry>
</tgroup>
</table>
+ <note>
+ <para>
+ Before <productname>PostgreSQL</productname> 8.2, the containment
+ operators <literal>@></> and <literal><@</> were respectively
+ called <literal>~</> and <literal>@</>. These names are still
+ available, but are deprecated and will eventually be retired.
+ </para>
+ </note>
+
<indexterm>
<primary>area</primary>
</indexterm>
available for use with the <type>macaddr</type> type. The function
<literal><function>trunc</function>(<type>macaddr</type>)</literal> returns a MAC
address with the last 3 bytes set to zero. This can be used to
- associate the remaining prefix with a manufacturer. The directory
- <filename>contrib/mac</filename> in the source distribution
- contains some utilities to create and maintain such an association
- table.
+ associate the remaining prefix with a manufacturer.
</para>
<table id="macaddr-functions-table">
<entry><literal>t</literal></entry>
</row>
+ <row>
+ <entry> <literal>@></literal> </entry>
+ <entry>contains</entry>
+ <entry><literal>ARRAY[1,4,3] @> ARRAY[3,1]</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>t</literal></entry>
+ </row>
+
<row>
<entry> <literal>||</literal> </entry>
<entry>array-to-array concatenation</entry>
-<!-- $PostgreSQL: pgsql/doc/src/sgml/indices.sgml,v 1.59 2006/09/04 19:58:02 momjian Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/indices.sgml,v 1.60 2006/09/10 00:29:34 tgl Exp $ -->
<chapter id="indexes">
<title id="indexes-title">Indexes</title>
<member><literal>&<|</literal></member>
<member><literal>|&></literal></member>
<member><literal>|>></literal></member>
- <member><literal>~</literal></member>
- <member><literal>@</literal></member>
+ <member><literal>@></literal></member>
+ <member><literal><@</literal></member>
<member><literal>~=</literal></member>
<member><literal>&&</literal></member>
</simplelist>
text[]), but no support for NULL elements. The following operations are
available:
- * contains: value_array @ query_array
- * overlap: value_array && query_array
- * contained: value_array ~ query_array
+ * contains: value_array @> query_array
+ * overlaps: value_array && query_array
+ * is contained by: value_array <@ query_array
Synopsis
--------
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/gist/gistproc.c,v 1.7 2006/07/14 14:52:16 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gist/gistproc.c,v 1.8 2006/09/10 00:29:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
PointerGetDatum(query)));
break;
case RTContainsStrategyNumber:
+ case RTOldContainsStrategyNumber:
retval = DatumGetBool(DirectFunctionCall2(box_contain,
PointerGetDatum(key),
PointerGetDatum(query)));
break;
case RTContainedByStrategyNumber:
+ case RTOldContainedByStrategyNumber:
retval = DatumGetBool(DirectFunctionCall2(box_contained,
PointerGetDatum(key),
PointerGetDatum(query)));
break;
case RTSameStrategyNumber:
case RTContainsStrategyNumber:
+ case RTOldContainsStrategyNumber:
retval = DatumGetBool(DirectFunctionCall2(box_contain,
PointerGetDatum(key),
PointerGetDatum(query)));
break;
case RTContainedByStrategyNumber:
+ case RTOldContainedByStrategyNumber:
retval = DatumGetBool(DirectFunctionCall2(box_overlap,
PointerGetDatum(key),
PointerGetDatum(query)));
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/gist.h,v 1.54 2006/06/28 12:00:14 teodor Exp $
+ * $PostgreSQL: pgsql/src/include/access/gist.h,v 1.55 2006/09/10 00:29:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#define RTOverRightStrategyNumber 4
#define RTRightStrategyNumber 5
#define RTSameStrategyNumber 6
-#define RTContainsStrategyNumber 7
-#define RTContainedByStrategyNumber 8
+#define RTContainsStrategyNumber 7 /* for @> */
+#define RTContainedByStrategyNumber 8 /* for <@ */
#define RTOverBelowStrategyNumber 9
#define RTBelowStrategyNumber 10
#define RTAboveStrategyNumber 11
#define RTOverAboveStrategyNumber 12
+#define RTOldContainsStrategyNumber 13 /* for old spelling of @> */
+#define RTOldContainedByStrategyNumber 14 /* for old spelling of <@ */
/*
* Page opaque data in a GiST index page.
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.354 2006/09/05 21:08:36 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.355 2006/09/10 00:29:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200609051
+#define CATALOG_VERSION_NO 200609091
#endif
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.73 2006/07/21 20:51:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.74 2006/09/10 00:29:34 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
DATA(insert ( 2593 0 10 f 2570 ));
DATA(insert ( 2593 0 11 f 2573 ));
DATA(insert ( 2593 0 12 f 2572 ));
+DATA(insert ( 2593 0 13 f 2863 ));
+DATA(insert ( 2593 0 14 f 2862 ));
/*
* gist poly_ops (supports polygons)
DATA(insert ( 2594 0 10 t 2574 ));
DATA(insert ( 2594 0 11 t 2577 ));
DATA(insert ( 2594 0 12 t 2576 ));
+DATA(insert ( 2594 0 13 t 2861 ));
+DATA(insert ( 2594 0 14 t 2860 ));
/*
* gist circle_ops
DATA(insert ( 2595 0 10 t 1515 ));
DATA(insert ( 2595 0 11 t 1514 ));
DATA(insert ( 2595 0 12 t 2590 ));
+DATA(insert ( 2595 0 13 t 2865 ));
+DATA(insert ( 2595 0 14 t 2864 ));
/*
* gin _int4_ops
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.144 2006/07/21 20:51:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.145 2006/09/10 00:29:34 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
DATA(insert OID = 486 ( "&<" PGNSP PGUID b f 604 604 16 0 0 0 0 0 0 poly_overleft positionsel positionjoinsel ));
DATA(insert OID = 487 ( "&>" PGNSP PGUID b f 604 604 16 0 0 0 0 0 0 poly_overright positionsel positionjoinsel ));
DATA(insert OID = 488 ( ">>" PGNSP PGUID b f 604 604 16 0 0 0 0 0 0 poly_right positionsel positionjoinsel ));
-DATA(insert OID = 489 ( "@" PGNSP PGUID b f 604 604 16 490 0 0 0 0 0 poly_contained contsel contjoinsel ));
-DATA(insert OID = 490 ( "~" PGNSP PGUID b f 604 604 16 489 0 0 0 0 0 poly_contain contsel contjoinsel ));
+DATA(insert OID = 489 ( "<@" PGNSP PGUID b f 604 604 16 490 0 0 0 0 0 poly_contained contsel contjoinsel ));
+DATA(insert OID = 490 ( "@>" PGNSP PGUID b f 604 604 16 489 0 0 0 0 0 poly_contain contsel contjoinsel ));
DATA(insert OID = 491 ( "~=" PGNSP PGUID b f 604 604 16 491 0 0 0 0 0 poly_same eqsel eqjoinsel ));
DATA(insert OID = 492 ( "&&" PGNSP PGUID b f 604 604 16 492 0 0 0 0 0 poly_overlap areasel areajoinsel ));
DATA(insert OID = 493 ( "<<" PGNSP PGUID b f 603 603 16 0 0 0 0 0 0 box_left positionsel positionjoinsel ));
DATA(insert OID = 494 ( "&<" PGNSP PGUID b f 603 603 16 0 0 0 0 0 0 box_overleft positionsel positionjoinsel ));
DATA(insert OID = 495 ( "&>" PGNSP PGUID b f 603 603 16 0 0 0 0 0 0 box_overright positionsel positionjoinsel ));
DATA(insert OID = 496 ( ">>" PGNSP PGUID b f 603 603 16 0 0 0 0 0 0 box_right positionsel positionjoinsel ));
-DATA(insert OID = 497 ( "@" PGNSP PGUID b f 603 603 16 498 0 0 0 0 0 box_contained contsel contjoinsel ));
-DATA(insert OID = 498 ( "~" PGNSP PGUID b f 603 603 16 497 0 0 0 0 0 box_contain contsel contjoinsel ));
+DATA(insert OID = 497 ( "<@" PGNSP PGUID b f 603 603 16 498 0 0 0 0 0 box_contained contsel contjoinsel ));
+DATA(insert OID = 498 ( "@>" PGNSP PGUID b f 603 603 16 497 0 0 0 0 0 box_contain contsel contjoinsel ));
DATA(insert OID = 499 ( "~=" PGNSP PGUID b f 603 603 16 499 0 0 0 0 0 box_same eqsel eqjoinsel ));
DATA(insert OID = 500 ( "&&" PGNSP PGUID b f 603 603 16 500 0 0 0 0 0 box_overlap areasel areajoinsel ));
DATA(insert OID = 501 ( ">=" PGNSP PGUID b f 603 603 16 505 504 0 0 0 0 box_ge areasel areajoinsel ));
DATA(insert OID = 508 ( ">>" PGNSP PGUID b f 600 600 16 0 0 0 0 0 0 point_right positionsel positionjoinsel ));
DATA(insert OID = 509 ( "<^" PGNSP PGUID b f 600 600 16 0 0 0 0 0 0 point_below positionsel positionjoinsel ));
DATA(insert OID = 510 ( "~=" PGNSP PGUID b f 600 600 16 510 713 0 0 0 0 point_eq eqsel eqjoinsel ));
-DATA(insert OID = 511 ( "@" PGNSP PGUID b f 600 603 16 0 0 0 0 0 0 on_pb - - ));
-DATA(insert OID = 512 ( "@" PGNSP PGUID b f 600 602 16 755 0 0 0 0 0 on_ppath - - ));
+DATA(insert OID = 511 ( "<@" PGNSP PGUID b f 600 603 16 0 0 0 0 0 0 on_pb - - ));
+DATA(insert OID = 512 ( "<@" PGNSP PGUID b f 600 602 16 755 0 0 0 0 0 on_ppath - - ));
DATA(insert OID = 513 ( "@@" PGNSP PGUID l f 0 603 600 0 0 0 0 0 0 box_center - - ));
DATA(insert OID = 514 ( "*" PGNSP PGUID b f 23 23 23 514 0 0 0 0 0 int4mul - - ));
DATA(insert OID = 517 ( "<->" PGNSP PGUID b f 600 600 701 517 0 0 0 0 0 point_distance - - ));
DATA(insert OID = 737 ( "-" PGNSP PGUID b f 602 600 602 0 0 0 0 0 0 path_sub_pt - - ));
DATA(insert OID = 738 ( "*" PGNSP PGUID b f 602 600 602 0 0 0 0 0 0 path_mul_pt - - ));
DATA(insert OID = 739 ( "/" PGNSP PGUID b f 602 600 602 0 0 0 0 0 0 path_div_pt - - ));
-DATA(insert OID = 755 ( "~" PGNSP PGUID b f 602 600 16 512 0 0 0 0 0 path_contain_pt - - ));
-DATA(insert OID = 756 ( "@" PGNSP PGUID b f 600 604 16 757 0 0 0 0 0 pt_contained_poly - - ));
-DATA(insert OID = 757 ( "~" PGNSP PGUID b f 604 600 16 756 0 0 0 0 0 poly_contain_pt - - ));
-DATA(insert OID = 758 ( "@" PGNSP PGUID b f 600 718 16 759 0 0 0 0 0 pt_contained_circle - - ));
-DATA(insert OID = 759 ( "~" PGNSP PGUID b f 718 600 16 758 0 0 0 0 0 circle_contain_pt - - ));
+DATA(insert OID = 755 ( "@>" PGNSP PGUID b f 602 600 16 512 0 0 0 0 0 path_contain_pt - - ));
+DATA(insert OID = 756 ( "<@" PGNSP PGUID b f 600 604 16 757 0 0 0 0 0 pt_contained_poly - - ));
+DATA(insert OID = 757 ( "@>" PGNSP PGUID b f 604 600 16 756 0 0 0 0 0 poly_contain_pt - - ));
+DATA(insert OID = 758 ( "<@" PGNSP PGUID b f 600 718 16 759 0 0 0 0 0 pt_contained_circle - - ));
+DATA(insert OID = 759 ( "@>" PGNSP PGUID b f 718 600 16 758 0 0 0 0 0 circle_contain_pt - - ));
DATA(insert OID = 773 ( "@" PGNSP PGUID l f 0 23 23 0 0 0 0 0 0 int4abs - - ));
DATA(insert OID = 965 ( "^" PGNSP PGUID b f 701 701 701 0 0 0 0 0 0 dpow - - ));
DATA(insert OID = 966 ( "+" PGNSP PGUID b f 1034 1033 1034 0 0 0 0 0 0 aclinsert - - ));
DATA(insert OID = 967 ( "-" PGNSP PGUID b f 1034 1033 1034 0 0 0 0 0 0 aclremove - - ));
-DATA(insert OID = 968 ( "~" PGNSP PGUID b f 1034 1033 16 0 0 0 0 0 0 aclcontains - - ));
+DATA(insert OID = 968 ( "@>" PGNSP PGUID b f 1034 1033 16 0 0 0 0 0 0 aclcontains - - ));
DATA(insert OID = 974 ( "=" PGNSP PGUID b t 1033 1033 16 974 0 0 0 0 0 aclitemeq eqsel eqjoinsel ));
/* additional geometric operators - thomas 1997-07-09 */
DATA(insert OID = 1507 ( "&<" PGNSP PGUID b f 718 718 16 0 0 0 0 0 0 circle_overleft positionsel positionjoinsel ));
DATA(insert OID = 1508 ( "&>" PGNSP PGUID b f 718 718 16 0 0 0 0 0 0 circle_overright positionsel positionjoinsel ));
DATA(insert OID = 1509 ( ">>" PGNSP PGUID b f 718 718 16 0 0 0 0 0 0 circle_right positionsel positionjoinsel ));
-DATA(insert OID = 1510 ( "@" PGNSP PGUID b f 718 718 16 1511 0 0 0 0 0 circle_contained contsel contjoinsel ));
-DATA(insert OID = 1511 ( "~" PGNSP PGUID b f 718 718 16 1510 0 0 0 0 0 circle_contain contsel contjoinsel ));
+DATA(insert OID = 1510 ( "<@" PGNSP PGUID b f 718 718 16 1511 0 0 0 0 0 circle_contained contsel contjoinsel ));
+DATA(insert OID = 1511 ( "@>" PGNSP PGUID b f 718 718 16 1510 0 0 0 0 0 circle_contain contsel contjoinsel ));
DATA(insert OID = 1512 ( "~=" PGNSP PGUID b f 718 718 16 1512 0 0 0 0 0 circle_same eqsel eqjoinsel ));
DATA(insert OID = 1513 ( "&&" PGNSP PGUID b f 718 718 16 1513 0 0 0 0 0 circle_overlap areasel areajoinsel ));
DATA(insert OID = 1514 ( "|>>" PGNSP PGUID b f 718 718 16 0 0 0 0 0 0 circle_above positionsel positionjoinsel ));
DATA(insert OID = 1538 ( "?#" PGNSP PGUID b f 601 603 16 0 0 0 0 0 0 inter_sb - - ));
DATA(insert OID = 1539 ( "?#" PGNSP PGUID b f 628 603 16 0 0 0 0 0 0 inter_lb - - ));
-DATA(insert OID = 1546 ( "@" PGNSP PGUID b f 600 628 16 0 0 0 0 0 0 on_pl - - ));
-DATA(insert OID = 1547 ( "@" PGNSP PGUID b f 600 601 16 0 0 0 0 0 0 on_ps - - ));
-DATA(insert OID = 1548 ( "@" PGNSP PGUID b f 601 628 16 0 0 0 0 0 0 on_sl - - ));
-DATA(insert OID = 1549 ( "@" PGNSP PGUID b f 601 603 16 0 0 0 0 0 0 on_sb - - ));
+DATA(insert OID = 1546 ( "<@" PGNSP PGUID b f 600 628 16 0 0 0 0 0 0 on_pl - - ));
+DATA(insert OID = 1547 ( "<@" PGNSP PGUID b f 600 601 16 0 0 0 0 0 0 on_ps - - ));
+DATA(insert OID = 1548 ( "<@" PGNSP PGUID b f 601 628 16 0 0 0 0 0 0 on_sl - - ));
+DATA(insert OID = 1549 ( "<@" PGNSP PGUID b f 601 603 16 0 0 0 0 0 0 on_sb - - ));
DATA(insert OID = 1557 ( "##" PGNSP PGUID b f 600 628 600 0 0 0 0 0 0 close_pl - - ));
DATA(insert OID = 1558 ( "##" PGNSP PGUID b f 600 601 600 0 0 0 0 0 0 close_ps - - ));
DATA(insert OID = 2589 ( "&<|" PGNSP PGUID b f 718 718 16 0 0 0 0 0 0 circle_overbelow positionsel positionjoinsel ));
DATA(insert OID = 2590 ( "|&>" PGNSP PGUID b f 718 718 16 0 0 0 0 0 0 circle_overabove positionsel positionjoinsel ));
-/* overlap/contains/contained from arrays */
+/* overlap/contains/contained for arrays */
DATA(insert OID = 2750 ( "&&" PGNSP PGUID b f 2277 2277 16 2750 0 0 0 0 0 arrayoverlap areasel areajoinsel ));
-DATA(insert OID = 2751 ( "@" PGNSP PGUID b f 2277 2277 16 2752 0 0 0 0 0 arraycontains contsel contjoinsel ));
-DATA(insert OID = 2752 ( "~" PGNSP PGUID b f 2277 2277 16 2751 0 0 0 0 0 arraycontained contsel contjoinsel ));
+DATA(insert OID = 2751 ( "@>" PGNSP PGUID b f 2277 2277 16 2752 0 0 0 0 0 arraycontains contsel contjoinsel ));
+DATA(insert OID = 2752 ( "<@" PGNSP PGUID b f 2277 2277 16 2751 0 0 0 0 0 arraycontained contsel contjoinsel ));
+
+/* obsolete names for contains/contained-by operators; remove these someday */
+DATA(insert OID = 2860 ( "@" PGNSP PGUID b f 604 604 16 2861 0 0 0 0 0 poly_contained contsel contjoinsel ));
+DATA(insert OID = 2861 ( "~" PGNSP PGUID b f 604 604 16 2860 0 0 0 0 0 poly_contain contsel contjoinsel ));
+DATA(insert OID = 2862 ( "@" PGNSP PGUID b f 603 603 16 2863 0 0 0 0 0 box_contained contsel contjoinsel ));
+DATA(insert OID = 2863 ( "~" PGNSP PGUID b f 603 603 16 2862 0 0 0 0 0 box_contain contsel contjoinsel ));
+DATA(insert OID = 2864 ( "@" PGNSP PGUID b f 718 718 16 2865 0 0 0 0 0 circle_contained contsel contjoinsel ));
+DATA(insert OID = 2865 ( "~" PGNSP PGUID b f 718 718 16 2864 0 0 0 0 0 circle_contain contsel contjoinsel ));
+DATA(insert OID = 2866 ( "@" PGNSP PGUID b f 600 603 16 0 0 0 0 0 0 on_pb - - ));
+DATA(insert OID = 2867 ( "@" PGNSP PGUID b f 600 602 16 2868 0 0 0 0 0 on_ppath - - ));
+DATA(insert OID = 2868 ( "~" PGNSP PGUID b f 602 600 16 2867 0 0 0 0 0 path_contain_pt - - ));
+DATA(insert OID = 2869 ( "@" PGNSP PGUID b f 600 604 16 2870 0 0 0 0 0 pt_contained_poly - - ));
+DATA(insert OID = 2870 ( "~" PGNSP PGUID b f 604 600 16 2869 0 0 0 0 0 poly_contain_pt - - ));
+DATA(insert OID = 2871 ( "@" PGNSP PGUID b f 600 718 16 2872 0 0 0 0 0 pt_contained_circle - - ));
+DATA(insert OID = 2872 ( "~" PGNSP PGUID b f 718 600 16 2871 0 0 0 0 0 circle_contain_pt - - ));
+DATA(insert OID = 2873 ( "@" PGNSP PGUID b f 600 628 16 0 0 0 0 0 0 on_pl - - ));
+DATA(insert OID = 2874 ( "@" PGNSP PGUID b f 600 601 16 0 0 0 0 0 0 on_ps - - ));
+DATA(insert OID = 2875 ( "@" PGNSP PGUID b f 601 628 16 0 0 0 0 0 0 on_sl - - ));
+DATA(insert OID = 2876 ( "@" PGNSP PGUID b f 601 603 16 0 0 0 0 0 0 on_sb - - ));
+DATA(insert OID = 2877 ( "~" PGNSP PGUID b f 1034 1033 16 0 0 0 0 0 0 aclcontains - - ));
/*
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.422 2006/08/19 01:36:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.423 2006/09/10 00:29:34 tgl Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
DATA(insert OID = 191 ( box_right PGNSP PGUID 12 f f t f i 2 16 "603 603" _null_ _null_ _null_ box_right - _null_ ));
DESCR("is right of");
DATA(insert OID = 192 ( box_contained PGNSP PGUID 12 f f t f i 2 16 "603 603" _null_ _null_ _null_ box_contained - _null_ ));
-DESCR("contained in?");
+DESCR("is contained by?");
/* OIDS 200 - 299 */
DATA(insert OID = 263 ( tintervalsame PGNSP PGUID 12 f f t f i 2 16 "704 704" _null_ _null_ _null_ tintervalsame - _null_ ));
DESCR("same as?");
DATA(insert OID = 264 ( tintervalct PGNSP PGUID 12 f f t f i 2 16 "704 704" _null_ _null_ _null_ tintervalct - _null_ ));
-DESCR("less-than");
+DESCR("contains?");
DATA(insert OID = 265 ( tintervalov PGNSP PGUID 12 f f t f i 2 16 "704 704" _null_ _null_ _null_ tintervalov - _null_ ));
DESCR("overlaps");
DATA(insert OID = 266 ( tintervalleneq PGNSP PGUID 12 f f t f i 2 16 "704 703" _null_ _null_ _null_ tintervalleneq - _null_ ));
DATA(insert OID = 344 ( poly_right PGNSP PGUID 12 f f t f i 2 16 "604 604" _null_ _null_ _null_ poly_right - _null_ ));
DESCR("is right of");
DATA(insert OID = 345 ( poly_contained PGNSP PGUID 12 f f t f i 2 16 "604 604" _null_ _null_ _null_ poly_contained - _null_ ));
-DESCR("contained in?");
+DESCR("is contained by?");
DATA(insert OID = 346 ( poly_overlap PGNSP PGUID 12 f f t f i 2 16 "604 604" _null_ _null_ _null_ poly_overlap - _null_ ));
DESCR("overlaps");
DATA(insert OID = 347 ( poly_in PGNSP PGUID 12 f f t f i 1 604 "2275" _null_ _null_ _null_ poly_in - _null_ ));
DATA(insert OID = 1036 ( aclremove PGNSP PGUID 12 f f t f i 2 1034 "1034 1033" _null_ _null_ _null_ aclremove - _null_ ));
DESCR("remove ACL item");
DATA(insert OID = 1037 ( aclcontains PGNSP PGUID 12 f f t f i 2 16 "1034 1033" _null_ _null_ _null_ aclcontains - _null_ ));
-DESCR("does ACL contain item?");
+DESCR("ACL contains item?");
DATA(insert OID = 1062 ( aclitemeq PGNSP PGUID 12 f f t f i 2 16 "1033 1033" _null_ _null_ _null_ aclitem_eq - _null_ ));
DESCR("equality operator for ACL items");
DATA(insert OID = 1365 ( makeaclitem PGNSP PGUID 12 f f t f i 4 1033 "26 26 25 16" _null_ _null_ _null_ makeaclitem - _null_ ));
DATA(insert OID = 1457 ( circle_right PGNSP PGUID 12 f f t f i 2 16 "718 718" _null_ _null_ _null_ circle_right - _null_ ));
DESCR("is right of");
DATA(insert OID = 1458 ( circle_contained PGNSP PGUID 12 f f t f i 2 16 "718 718" _null_ _null_ _null_ circle_contained - _null_ ));
-DESCR("contained in?");
+DESCR("is contained by?");
DATA(insert OID = 1459 ( circle_overlap PGNSP PGUID 12 f f t f i 2 16 "718 718" _null_ _null_ _null_ circle_overlap - _null_ ));
DESCR("overlaps");
DATA(insert OID = 1460 ( circle_below PGNSP PGUID 12 f f t f i 2 16 "718 718" _null_ _null_ _null_ circle_below - _null_ ));
DATA(insert OID = 1477 ( circle_contain_pt PGNSP PGUID 12 f f t f i 2 16 "718 600" _null_ _null_ _null_ circle_contain_pt - _null_ ));
DESCR("circle contains point?");
DATA(insert OID = 1478 ( pt_contained_circle PGNSP PGUID 12 f f t f i 2 16 "600 718" _null_ _null_ _null_ pt_contained_circle - _null_ ));
-DESCR("point inside circle?");
+DESCR("point contained in circle?");
DATA(insert OID = 1479 ( circle PGNSP PGUID 12 f f t f i 1 718 "603" _null_ _null_ _null_ box_circle - _null_ ));
DESCR("convert box to circle");
DATA(insert OID = 1480 ( box PGNSP PGUID 12 f f t f i 1 603 "718" _null_ _null_ _null_ circle_box - _null_ ));
/* overlap/contains/contained */
DATA(insert OID = 2747 ( arrayoverlap PGNSP PGUID 12 f f t f i 2 16 "2277 2277" _null_ _null_ _null_ arrayoverlap - _null_ ));
-DESCR("anyarray overlap");
+DESCR("overlaps");
DATA(insert OID = 2748 ( arraycontains PGNSP PGUID 12 f f t f i 2 16 "2277 2277" _null_ _null_ _null_ arraycontains - _null_ ));
-DESCR("anyarray contains");
+DESCR("contains");
DATA(insert OID = 2749 ( arraycontained PGNSP PGUID 12 f f t f i 2 16 "2277 2277" _null_ _null_ _null_ arraycontained - _null_ ));
-DESCR("anyarray contained");
+DESCR("is contained by");
/*
* Symbolic values for provolatile column: these indicate whether the result
{0,1,2,3}
(1 row)
-SELECT * FROM array_op_test WHERE i @ '{32}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i @> '{32}' ORDER BY seqno;
seqno | i | t
-------+---------------------------------+------------------------------------------------------------------------------------------------------------------------------------
6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
100 | {85,32,57,39,49,84,32,3,30} | {AAAAAAA80240,AAAAAAAAAAAAAAAA1729,AAAAA60038,AAAAAAAAAAA92631,AAAAAAAA9523}
(6 rows)
-SELECT * FROM array_op_test WHERE i @ '{17}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i @> '{17}' ORDER BY seqno;
seqno | i | t
-------+---------------------------------+------------------------------------------------------------------------------------------------------------------------------------
6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
89 | {40,32,17,6,30,88} | {AA44673,AAAAAAAAAAA6119,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAAAAAAAA47955,AAAAAAAAAAAAAAAA33598,AAAAAAAAAAA33576,AA44673}
(8 rows)
-SELECT * FROM array_op_test WHERE i @ '{32,17}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i @> '{32,17}' ORDER BY seqno;
seqno | i | t
-------+---------------------------------+------------------------------------------------------------------------------------------------------------------------------------
6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
100 | {85,32,57,39,49,84,32,3,30} | {AAAAAAA80240,AAAAAAAAAAAAAAAA1729,AAAAA60038,AAAAAAAAAAA92631,AAAAAAAA9523}
(11 rows)
-SELECT * FROM array_op_test WHERE i ~ '{38,34,32,89}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i <@ '{38,34,32,89}' ORDER BY seqno;
seqno | i | t
-------+---------------+----------------------------------------------------------------------------------------------------------------------------
40 | {34} | {AAAAAAAAAAAAAA10611,AAAAAAAAAAAAAAAAAAA1205,AAAAAAAAAAA50956,AAAAAAAAAAAAAAAA31334,AAAAA70466,AAAAAAAA81587,AAAAAAA74623}
98 | {38,34,32,89} | {AAAAAAAAAAAAAAAAAA71621,AAAA8857,AAAAAAAAAAAAAAAAAAA65037,AAAAAAAAAAAAAAAA31334,AAAAAAAAAA48845}
(3 rows)
-SELECT * FROM array_op_test WHERE t @ '{AAAAAAAA72908}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t @> '{AAAAAAAA72908}' ORDER BY seqno;
seqno | i | t
-------+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------
22 | {11,6,56,62,53,30} | {AAAAAAAA72908}
79 | {45} | {AAAAAAAAAA646,AAAAAAAAAAAAAAAAAAA70415,AAAAAA43678,AAAAAAAA72908}
(4 rows)
-SELECT * FROM array_op_test WHERE t @ '{AAAAAAAAAA646}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t @> '{AAAAAAAAAA646}' ORDER BY seqno;
seqno | i | t
-------+------------------+--------------------------------------------------------------------
15 | {17,14,16,63,67} | {AA6416,AAAAAAAAAA646,AAAAA95309}
96 | {23,97,43} | {AAAAAAAAAA646,A87088}
(3 rows)
-SELECT * FROM array_op_test WHERE t @ '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t @> '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
seqno | i | t
-------+------+--------------------------------------------------------------------
79 | {45} | {AAAAAAAAAA646,AAAAAAAAAAAAAAAAAAA70415,AAAAAA43678,AAAAAAAA72908}
96 | {23,97,43} | {AAAAAAAAAA646,A87088}
(6 rows)
-SELECT * FROM array_op_test WHERE t ~ '{AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t <@ '{AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}' ORDER BY seqno;
seqno | i | t
-------+--------------------+-----------------------------------------------------------------------------------------------------------
22 | {11,6,56,62,53,30} | {AAAAAAAA72908}
-- contained in
SELECT '' AS three, b.f1
FROM BOX_TBL b
- WHERE b.f1 @ box '(0,0,3,3)';
+ WHERE b.f1 <@ box '(0,0,3,3)';
three | f1
-------+-------------
| (2,2),(0,0)
-- contains
SELECT '' AS three, b.f1
FROM BOX_TBL b
- WHERE box '(0,0,3,3)' ~ b.f1;
+ WHERE box '(0,0,3,3)' @> b.f1;
three | f1
-------+-------------
| (2,2),(0,0)
-- wholly-contained
SELECT '' AS one, b1.*, b2.*
FROM BOX_TBL b1, BOX_TBL b2
- WHERE b1.f1 ~ b2.f1 and not b1.f1 ~= b2.f1;
+ WHERE b1.f1 @> b2.f1 and not b1.f1 ~= b2.f1;
one | f1 | f1
-----+-------------+-------------
| (3,3),(1,1) | (3,3),(3,3)
SET enable_indexscan = ON;
SET enable_bitmapscan = ON;
CREATE INDEX intarrayidx ON array_index_op_test USING gin (i);
-SELECT * FROM array_index_op_test WHERE i @ '{32}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE i @> '{32}' ORDER BY seqno;
seqno | i | t
-------+---------------------------------+------------------------------------------------------------------------------------------------------------------------------------
6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
100 | {85,32,57,39,49,84,32,3,30} | {AAAAAAA80240,AAAAAAAAAAAAAAAA1729,AAAAA60038,AAAAAAAAAAA92631,AAAAAAAA9523}
(6 rows)
-SELECT * FROM array_index_op_test WHERE i @ '{17}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE i @> '{17}' ORDER BY seqno;
seqno | i | t
-------+---------------------------------+------------------------------------------------------------------------------------------------------------------------------------
6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
89 | {40,32,17,6,30,88} | {AA44673,AAAAAAAAAAA6119,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAAAAAAAA47955,AAAAAAAAAAAAAAAA33598,AAAAAAAAAAA33576,AA44673}
(8 rows)
-SELECT * FROM array_index_op_test WHERE i @ '{32,17}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE i @> '{32,17}' ORDER BY seqno;
seqno | i | t
-------+---------------------------------+------------------------------------------------------------------------------------------------------------------------------------
6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
100 | {85,32,57,39,49,84,32,3,30} | {AAAAAAA80240,AAAAAAAAAAAAAAAA1729,AAAAA60038,AAAAAAAAAAA92631,AAAAAAAA9523}
(11 rows)
-SELECT * FROM array_index_op_test WHERE i ~ '{38,34,32,89}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE i <@ '{38,34,32,89}' ORDER BY seqno;
seqno | i | t
-------+---------------+----------------------------------------------------------------------------------------------------------------------------
40 | {34} | {AAAAAAAAAAAAAA10611,AAAAAAAAAAAAAAAAAAA1205,AAAAAAAAAAA50956,AAAAAAAAAAAAAAAA31334,AAAAA70466,AAAAAAAA81587,AAAAAAA74623}
(1 row)
CREATE INDEX textarrayidx ON array_index_op_test USING gin (t);
-SELECT * FROM array_index_op_test WHERE t @ '{AAAAAAAA72908}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE t @> '{AAAAAAAA72908}' ORDER BY seqno;
seqno | i | t
-------+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------
22 | {11,6,56,62,53,30} | {AAAAAAAA72908}
79 | {45} | {AAAAAAAAAA646,AAAAAAAAAAAAAAAAAAA70415,AAAAAA43678,AAAAAAAA72908}
(4 rows)
-SELECT * FROM array_index_op_test WHERE t @ '{AAAAAAAAAA646}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE t @> '{AAAAAAAAAA646}' ORDER BY seqno;
seqno | i | t
-------+------------------+--------------------------------------------------------------------
15 | {17,14,16,63,67} | {AA6416,AAAAAAAAAA646,AAAAA95309}
96 | {23,97,43} | {AAAAAAAAAA646,A87088}
(3 rows)
-SELECT * FROM array_index_op_test WHERE t @ '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE t @> '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
seqno | i | t
-------+------+--------------------------------------------------------------------
79 | {45} | {AAAAAAAAAA646,AAAAAAAAAAAAAAAAAAA70415,AAAAAA43678,AAAAAAAA72908}
96 | {23,97,43} | {AAAAAAAAAA646,A87088}
(6 rows)
-SELECT * FROM array_index_op_test WHERE t ~ '{AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE t <@ '{AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}' ORDER BY seqno;
seqno | i | t
-------+--------------------+-----------------------------------------------------------------------------------------------------------
22 | {11,6,56,62,53,30} | {AAAAAAAA72908}
-- Polygons
--
-- containment
-SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 ~ p.f1 AS contains
+SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 @> p.f1 AS contains
FROM POLYGON_TBL poly, POINT_TBL p;
twentyfour | f1 | f1 | contains
------------+------------+---------------------+----------
| (10,10) | ((0,1),(0,1)) | f
(24 rows)
-SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 @ poly.f1 AS contained
+SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 <@ poly.f1 AS contained
FROM POLYGON_TBL poly, POINT_TBL p;
twentyfour | f1 | f1 | contained
------------+------------+---------------------+-----------
-- Polygons
--
-- containment
-SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 ~ p.f1 AS contains
+SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 @> p.f1 AS contains
FROM POLYGON_TBL poly, POINT_TBL p;
twentyfour | f1 | f1 | contains
------------+------------+---------------------+----------
| (10,10) | ((0,1),(0,1)) | f
(24 rows)
-SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 @ poly.f1 AS contained
+SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 <@ poly.f1 AS contained
FROM POLYGON_TBL poly, POINT_TBL p;
twentyfour | f1 | f1 | contained
------------+------------+---------------------+-----------
-- Polygons
--
-- containment
-SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 ~ p.f1 AS contains
+SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 @> p.f1 AS contains
FROM POLYGON_TBL poly, POINT_TBL p;
twentyfour | f1 | f1 | contains
------------+------------+---------------------+----------
| (10,10) | ((0,1),(0,1)) | f
(24 rows)
-SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 @ poly.f1 AS contained
+SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 <@ poly.f1 AS contained
FROM POLYGON_TBL poly, POINT_TBL p;
twentyfour | f1 | f1 | contained
------------+------------+---------------------+-----------
-- Helper functions to deal with cases where binary-coercible matches are
-- allowed.
-- This should match IsBinaryCoercible() in parse_coerce.c.
-create function binary_coercible(oid, oid) returns bool as
-'SELECT ($1 = $2) OR
- EXISTS(select 1 from pg_cast where
+create function binary_coercible(oid, oid) returns bool as $$
+SELECT ($1 = $2) OR
+ EXISTS(select 1 from pg_catalog.pg_cast where
castsource = $1 and casttarget = $2 and
- castfunc = 0 and castcontext = ''i'') OR
- ( EXISTS(select 1 from pg_type source where
- source.oid = $1 and source.typelem != 0 )
- AND
- EXISTS(select 1 from pg_type target where
- target.oid = $2 and target.typname = ''anyarray'' ) )'
-language sql;
+ castfunc = 0 and castcontext = 'i') OR
+ ($2 = 'pg_catalog.anyarray'::pg_catalog.regtype AND
+ EXISTS(select 1 from pg_catalog.pg_type where
+ oid = $1 and typelem != 0 and typlen = -1))
+$$ language sql strict stable;
-- This one ignores castcontext, so it considers only physical equivalence
-- and not whether the coercion can be invoked implicitly.
-create function physically_coercible(oid, oid) returns bool as
-'SELECT ($1 = $2) OR
- EXISTS(select 1 from pg_cast where
+create function physically_coercible(oid, oid) returns bool as $$
+SELECT ($1 = $2) OR
+ EXISTS(select 1 from pg_catalog.pg_cast where
castsource = $1 and casttarget = $2 and
- castfunc = 0)'
-language sql;
+ castfunc = 0) OR
+ ($2 = 'pg_catalog.anyarray'::pg_catalog.regtype AND
+ EXISTS(select 1 from pg_catalog.pg_type where
+ oid = $1 and typelem != 0 and typlen = -1))
+$$ language sql strict stable;
-- **************** pg_proc ****************
-- Look for illegal values in pg_proc fields.
SELECT p1.oid, p1.proname
-- Detect missing pg_amop entries: should have as many strategy operators
-- as AM expects for each opclass for the AM. When nondefault subtypes are
-- present, enforce condition separately for each subtype.
--- We have to exclude GiST and GIN, unfortunately, since its havn't got any fixed
--- requirements about strategy operators.
+-- We have to exclude GiST and GIN, unfortunately, since they haven't got
+-- any fixed requirements about strategy operators.
SELECT p1.oid, p1.amname, p2.oid, p2.opcname, p3.amopsubtype
FROM pg_am AS p1, pg_opclass AS p2, pg_amop AS p3
WHERE p2.opcamid = p1.oid AND p3.amopclaid = p2.oid AND
783 | 4 | &>
783 | 5 | >>
783 | 6 | ~=
- 783 | 7 | ~
- 783 | 8 | @
+ 783 | 7 | @>
+ 783 | 8 | <@
783 | 9 | &<|
783 | 10 | <<|
783 | 11 | |>>
783 | 12 | |&>
+ 783 | 13 | ~
+ 783 | 14 | @
2742 | 1 | &&
- 2742 | 2 | @
- 2742 | 3 | ~
+ 2742 | 2 | @>
+ 2742 | 3 | <@
2742 | 4 | =
-(28 rows)
+(30 rows)
-- Check that all operators linked to by opclass entries have selectivity
-- estimators. This is not absolutely required, but it seems a reasonable
-- point in box
SELECT '' AS three, p.* FROM POINT_TBL p
- WHERE p.f1 @ box '(0,0,100,100)';
+ WHERE p.f1 <@ box '(0,0,100,100)';
three | f1
-------+------------
| (0,0)
(3 rows)
SELECT '' AS three, p.* FROM POINT_TBL p
- WHERE not p.f1 @ box '(0,0,100,100)';
+ WHERE not p.f1 <@ box '(0,0,100,100)';
three | f1
-------+----------
| (-10,0)
(3 rows)
SELECT '' AS two, p.* FROM POINT_TBL p
- WHERE p.f1 @ path '[(0,0),(-10,0),(-10,10)]';
+ WHERE p.f1 <@ path '[(0,0),(-10,0),(-10,10)]';
two | f1
-----+---------
| (0,0)
-- contained
SELECT '' AS one, p.*
FROM POLYGON_TBL p
- WHERE p.f1 @ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
+ WHERE p.f1 <@ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
one | f1
-----+---------------------
| ((3,1),(3,3),(1,0))
-- contains
SELECT '' AS one, p.*
FROM POLYGON_TBL p
- WHERE p.f1 ~ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
+ WHERE p.f1 @> polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
one | f1
-----+---------------------
| ((3,1),(3,3),(1,0))
(1 row)
-- contained in
-SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' @ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' <@ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
false
-------
f
(1 row)
-- contains
-SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' ~ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' @> polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
false
-------
f
SELECT ARRAY[0,0] || ARRAY[1,1] || ARRAY[2,2] AS "{0,0,1,1,2,2}";
SELECT 0 || ARRAY[1,2] || 3 AS "{0,1,2,3}";
-SELECT * FROM array_op_test WHERE i @ '{32}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i @> '{32}' ORDER BY seqno;
SELECT * FROM array_op_test WHERE i && '{32}' ORDER BY seqno;
-SELECT * FROM array_op_test WHERE i @ '{17}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i @> '{17}' ORDER BY seqno;
SELECT * FROM array_op_test WHERE i && '{17}' ORDER BY seqno;
-SELECT * FROM array_op_test WHERE i @ '{32,17}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i @> '{32,17}' ORDER BY seqno;
SELECT * FROM array_op_test WHERE i && '{32,17}' ORDER BY seqno;
-SELECT * FROM array_op_test WHERE i ~ '{38,34,32,89}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i <@ '{38,34,32,89}' ORDER BY seqno;
-SELECT * FROM array_op_test WHERE t @ '{AAAAAAAA72908}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t @> '{AAAAAAAA72908}' ORDER BY seqno;
SELECT * FROM array_op_test WHERE t && '{AAAAAAAA72908}' ORDER BY seqno;
-SELECT * FROM array_op_test WHERE t @ '{AAAAAAAAAA646}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t @> '{AAAAAAAAAA646}' ORDER BY seqno;
SELECT * FROM array_op_test WHERE t && '{AAAAAAAAAA646}' ORDER BY seqno;
-SELECT * FROM array_op_test WHERE t @ '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t @> '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
SELECT * FROM array_op_test WHERE t && '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
-SELECT * FROM array_op_test WHERE t ~ '{AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t <@ '{AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}' ORDER BY seqno;
-- array casts
SELECT ARRAY[1,2,3]::text[]::int[]::float8[] AS "{1,2,3}";
-- contained in
SELECT '' AS three, b.f1
FROM BOX_TBL b
- WHERE b.f1 @ box '(0,0,3,3)';
+ WHERE b.f1 <@ box '(0,0,3,3)';
-- contains
SELECT '' AS three, b.f1
FROM BOX_TBL b
- WHERE box '(0,0,3,3)' ~ b.f1;
+ WHERE box '(0,0,3,3)' @> b.f1;
-- box equality
SELECT '' AS one, b.f1
-- wholly-contained
SELECT '' AS one, b1.*, b2.*
FROM BOX_TBL b1, BOX_TBL b2
- WHERE b1.f1 ~ b2.f1 and not b1.f1 ~= b2.f1;
+ WHERE b1.f1 @> b2.f1 and not b1.f1 ~= b2.f1;
SELECT '' AS four, height(f1), width(f1) FROM BOX_TBL;
CREATE INDEX intarrayidx ON array_index_op_test USING gin (i);
-SELECT * FROM array_index_op_test WHERE i @ '{32}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE i @> '{32}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i && '{32}' ORDER BY seqno;
-SELECT * FROM array_index_op_test WHERE i @ '{17}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE i @> '{17}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i && '{17}' ORDER BY seqno;
-SELECT * FROM array_index_op_test WHERE i @ '{32,17}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE i @> '{32,17}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i && '{32,17}' ORDER BY seqno;
-SELECT * FROM array_index_op_test WHERE i ~ '{38,34,32,89}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE i <@ '{38,34,32,89}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i = '{47,77}' ORDER BY seqno;
CREATE INDEX textarrayidx ON array_index_op_test USING gin (t);
-SELECT * FROM array_index_op_test WHERE t @ '{AAAAAAAA72908}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE t @> '{AAAAAAAA72908}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE t && '{AAAAAAAA72908}' ORDER BY seqno;
-SELECT * FROM array_index_op_test WHERE t @ '{AAAAAAAAAA646}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE t @> '{AAAAAAAAAA646}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE t && '{AAAAAAAAAA646}' ORDER BY seqno;
-SELECT * FROM array_index_op_test WHERE t @ '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE t @> '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE t && '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
-SELECT * FROM array_index_op_test WHERE t ~ '{AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}' ORDER BY seqno;
+SELECT * FROM array_index_op_test WHERE t <@ '{AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE t = '{AAAAAAAAAA646,A87088}' ORDER BY seqno;
--
-- containment
-SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 ~ p.f1 AS contains
+SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 @> p.f1 AS contains
FROM POLYGON_TBL poly, POINT_TBL p;
-SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 @ poly.f1 AS contained
+SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 <@ poly.f1 AS contained
FROM POLYGON_TBL poly, POINT_TBL p;
SELECT '' AS four, npoints(f1) AS npoints, f1 AS polygon
-- allowed.
-- This should match IsBinaryCoercible() in parse_coerce.c.
-create function binary_coercible(oid, oid) returns bool as
-'SELECT ($1 = $2) OR
- EXISTS(select 1 from pg_cast where
+create function binary_coercible(oid, oid) returns bool as $$
+SELECT ($1 = $2) OR
+ EXISTS(select 1 from pg_catalog.pg_cast where
castsource = $1 and casttarget = $2 and
- castfunc = 0 and castcontext = ''i'') OR
- ( EXISTS(select 1 from pg_type source where
- source.oid = $1 and source.typelem != 0 )
- AND
- EXISTS(select 1 from pg_type target where
- target.oid = $2 and target.typname = ''anyarray'' ) )'
-language sql;
+ castfunc = 0 and castcontext = 'i') OR
+ ($2 = 'pg_catalog.anyarray'::pg_catalog.regtype AND
+ EXISTS(select 1 from pg_catalog.pg_type where
+ oid = $1 and typelem != 0 and typlen = -1))
+$$ language sql strict stable;
-- This one ignores castcontext, so it considers only physical equivalence
-- and not whether the coercion can be invoked implicitly.
-create function physically_coercible(oid, oid) returns bool as
-'SELECT ($1 = $2) OR
- EXISTS(select 1 from pg_cast where
+create function physically_coercible(oid, oid) returns bool as $$
+SELECT ($1 = $2) OR
+ EXISTS(select 1 from pg_catalog.pg_cast where
castsource = $1 and casttarget = $2 and
- castfunc = 0)'
-language sql;
+ castfunc = 0) OR
+ ($2 = 'pg_catalog.anyarray'::pg_catalog.regtype AND
+ EXISTS(select 1 from pg_catalog.pg_type where
+ oid = $1 and typelem != 0 and typlen = -1))
+$$ language sql strict stable;
-- **************** pg_proc ****************
-- Detect missing pg_amop entries: should have as many strategy operators
-- as AM expects for each opclass for the AM. When nondefault subtypes are
-- present, enforce condition separately for each subtype.
--- We have to exclude GiST and GIN, unfortunately, since its havn't got any fixed
--- requirements about strategy operators.
+-- We have to exclude GiST and GIN, unfortunately, since they haven't got
+-- any fixed requirements about strategy operators.
SELECT p1.oid, p1.amname, p2.oid, p2.opcname, p3.amopsubtype
FROM pg_am AS p1, pg_opclass AS p2, pg_amop AS p3
-- point in box
SELECT '' AS three, p.* FROM POINT_TBL p
- WHERE p.f1 @ box '(0,0,100,100)';
+ WHERE p.f1 <@ box '(0,0,100,100)';
SELECT '' AS three, p.* FROM POINT_TBL p
- WHERE not p.f1 @ box '(0,0,100,100)';
+ WHERE not p.f1 <@ box '(0,0,100,100)';
SELECT '' AS two, p.* FROM POINT_TBL p
- WHERE p.f1 @ path '[(0,0),(-10,0),(-10,10)]';
+ WHERE p.f1 <@ path '[(0,0),(-10,0),(-10,10)]';
SELECT '' AS six, p.f1, p.f1 <-> point '(0,0)' AS dist
FROM POINT_TBL p
-- contained
SELECT '' AS one, p.*
FROM POLYGON_TBL p
- WHERE p.f1 @ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
+ WHERE p.f1 <@ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
-- same
SELECT '' AS one, p.*
-- contains
SELECT '' AS one, p.*
FROM POLYGON_TBL p
- WHERE p.f1 ~ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
+ WHERE p.f1 @> polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
--
-- polygon logic
SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' >> polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
-- contained in
-SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' @ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' <@ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
-- contains
-SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' ~ polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' @> polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
-- same
SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' ~= polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;