From ba920e1c9182eac55d5f1327ab0d29b721154277 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 10 Sep 2006 00:29:35 +0000 Subject: [PATCH] Rename contains/contained-by operators to @> and <@, per discussion that agreed these symbols are less easily confused. I made new pg_operator entries (with new OIDs) for the old names, so as to provide backward compatibility while making it pretty easy to remove the old names in some future release cycle. This commit only touches the core datatypes, contrib will be fixed separately. --- doc/src/sgml/func.sgml | 38 ++++++++++--- doc/src/sgml/indices.sgml | 6 +- src/backend/access/gin/README | 6 +- src/backend/access/gist/gistproc.c | 6 +- src/include/access/gist.h | 8 ++- src/include/catalog/catversion.h | 4 +- src/include/catalog/pg_amop.h | 8 ++- src/include/catalog/pg_operator.h | 64 ++++++++++++++-------- src/include/catalog/pg_proc.h | 20 +++---- src/test/regress/expected/arrays.out | 16 +++--- src/test/regress/expected/box.out | 6 +- src/test/regress/expected/create_index.out | 16 +++--- src/test/regress/expected/geometry.out | 4 +- src/test/regress/expected/geometry_1.out | 4 +- src/test/regress/expected/geometry_2.out | 4 +- src/test/regress/expected/opr_sanity.out | 47 ++++++++-------- src/test/regress/expected/point.out | 6 +- src/test/regress/expected/polygon.out | 8 +-- src/test/regress/sql/arrays.sql | 16 +++--- src/test/regress/sql/box.sql | 6 +- src/test/regress/sql/create_index.sql | 16 +++--- src/test/regress/sql/geometry.sql | 4 +- src/test/regress/sql/opr_sanity.sql | 35 ++++++------ src/test/regress/sql/point.sql | 6 +- src/test/regress/sql/polygon.sql | 8 +-- 25 files changed, 209 insertions(+), 153 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 13209c87a2..f1de523a22 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ - + Functions and Operators @@ -6498,14 +6498,14 @@ SELECT pg_sleep(1.5); lseg '((-1,0),(1,0))' ?|| lseg '((-1,2),(1,2))' - ~ + @> Contains? - circle '((0,0),2)' ~ point '(1,1)' + circle '((0,0),2)' @> point '(1,1)' - @ + <@ Contained in or on? - point '(1,1)' @ circle '((0,0),2)' + point '(1,1)' <@ circle '((0,0),2)' ~= @@ -6516,6 +6516,15 @@ SELECT pg_sleep(1.5); + + + Before PostgreSQL 8.2, the containment + operators @> and <@ were respectively + called ~ and @. These names are still + available, but are deprecated and will eventually be retired. + + + area @@ -7051,10 +7060,7 @@ SELECT pg_sleep(1.5); available for use with the macaddr type. The function trunc(macaddr) 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 - contrib/mac in the source distribution - contains some utilities to create and maintain such an association - table. + associate the remaining prefix with a manufacturer. @@ -7613,6 +7619,20 @@ SELECT NULLIF(value, '(none)') ... t + + @> + contains + ARRAY[1,4,3] @> ARRAY[3,1] + t + + + + <@ + is contained by + ARRAY[2,7] <@ ARRAY[1,7,4,2,6] + t + + || array-to-array concatenation diff --git a/doc/src/sgml/indices.sgml b/doc/src/sgml/indices.sgml index 5d4ecb6a2a..17630c586d 100644 --- a/doc/src/sgml/indices.sgml +++ b/doc/src/sgml/indices.sgml @@ -1,4 +1,4 @@ - + Indexes @@ -225,8 +225,8 @@ CREATE INDEX name ON table &<| |&> |>> - ~ - @ + @> + <@ ~= && diff --git a/src/backend/access/gin/README b/src/backend/access/gin/README index 2827f67268..73c0f540bc 100644 --- a/src/backend/access/gin/README +++ b/src/backend/access/gin/README @@ -31,9 +31,9 @@ Gin comes with built-in support for one-dimensional arrays (eg. integer[], 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 -------- diff --git a/src/backend/access/gist/gistproc.c b/src/backend/access/gist/gistproc.c index ff7bd7272e..ccd54bac12 100644 --- a/src/backend/access/gist/gistproc.c +++ b/src/backend/access/gist/gistproc.c @@ -10,7 +10,7 @@ * 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 $ * *------------------------------------------------------------------------- */ @@ -542,11 +542,13 @@ gist_box_leaf_consistent(BOX *key, BOX *query, StrategyNumber strategy) 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))); @@ -631,11 +633,13 @@ rtree_internal_consistent(BOX *key, BOX *query, StrategyNumber strategy) 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))); diff --git a/src/include/access/gist.h b/src/include/access/gist.h index 55d7634a73..1b3c042e95 100644 --- a/src/include/access/gist.h +++ b/src/include/access/gist.h @@ -9,7 +9,7 @@ * 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 $ * *------------------------------------------------------------------------- */ @@ -44,12 +44,14 @@ #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. diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 7e207a8ee2..bc8269e398 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * 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 $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200609051 +#define CATALOG_VERSION_NO 200609091 #endif diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h index 0bbf6b0127..b0da3c0382 100644 --- a/src/include/catalog/pg_amop.h +++ b/src/include/catalog/pg_amop.h @@ -23,7 +23,7 @@ * 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 @@ -611,6 +611,8 @@ DATA(insert ( 2593 0 9 f 2571 )); 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) @@ -628,6 +630,8 @@ DATA(insert ( 2594 0 9 t 2575 )); 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 @@ -645,6 +649,8 @@ DATA(insert ( 2595 0 9 t 2589 )); 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 diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h index 95349b2bf5..9072380e0e 100644 --- a/src/include/catalog/pg_operator.h +++ b/src/include/catalog/pg_operator.h @@ -8,7 +8,7 @@ * 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 @@ -159,16 +159,16 @@ DATA(insert OID = 485 ( "<<" PGNSP PGUID b f 604 604 16 0 0 0 0 0 0 po 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 )); @@ -181,8 +181,8 @@ DATA(insert OID = 507 ( "<<" PGNSP PGUID b f 600 600 16 0 0 0 0 0 0 po 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 - - )); @@ -364,11 +364,11 @@ DATA(insert OID = 736 ( "+" PGNSP PGUID b f 602 600 602 0 0 0 0 0 0 pat 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 - - )); @@ -424,7 +424,7 @@ DATA(insert OID = 918 ( "*" PGNSP PGUID b f 21 790 790 914 0 0 0 0 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 */ @@ -572,8 +572,8 @@ DATA(insert OID = 1506 ( "<<" PGNSP PGUID b f 718 718 16 0 0 0 0 0 0 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 )); @@ -603,10 +603,10 @@ DATA(insert OID = 1537 ( "?#" PGNSP PGUID b f 601 628 16 0 0 0 0 0 0 inte 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 - - )); @@ -878,10 +878,30 @@ DATA(insert OID = 2577 ( "|>>" PGNSP PGUID b f 604 604 16 0 0 0 0 0 0 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 - - )); /* diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index b066babc14..f78371fcad 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * 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 @@ -393,7 +393,7 @@ DESCR("overlaps or is right of"); 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 */ @@ -537,7 +537,7 @@ DESCR("greater-than-or-equal"); 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_ )); @@ -696,7 +696,7 @@ DESCR("overlaps or is right of"); 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_ )); @@ -1326,7 +1326,7 @@ DESCR("add/update ACL item"); 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_ )); @@ -1934,7 +1934,7 @@ DESCR("overlaps or is right of"); 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_ )); @@ -1974,7 +1974,7 @@ DESCR("distance between point and circle"); 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_ )); @@ -3934,11 +3934,11 @@ DESCR("GIN array support"); /* 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 diff --git a/src/test/regress/expected/arrays.out b/src/test/regress/expected/arrays.out index 561e4b0340..b0f9f69a57 100644 --- a/src/test/regress/expected/arrays.out +++ b/src/test/regress/expected/arrays.out @@ -302,7 +302,7 @@ SELECT 0 || ARRAY[1,2] || 3 AS "{0,1,2,3}"; {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} @@ -324,7 +324,7 @@ SELECT * FROM array_op_test WHERE i && '{32}' ORDER BY seqno; 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} @@ -350,7 +350,7 @@ SELECT * FROM array_op_test WHERE i && '{17}' ORDER BY seqno; 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} @@ -374,7 +374,7 @@ SELECT * FROM array_op_test WHERE i && '{32,17}' ORDER BY seqno; 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} @@ -382,7 +382,7 @@ SELECT * FROM array_op_test WHERE i ~ '{38,34,32,89}' ORDER BY seqno; 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} @@ -400,7 +400,7 @@ SELECT * FROM array_op_test WHERE t && '{AAAAAAAA72908}' ORDER BY seqno; 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} @@ -416,7 +416,7 @@ SELECT * FROM array_op_test WHERE t && '{AAAAAAAAAA646}' ORDER BY seqno; 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} @@ -433,7 +433,7 @@ SELECT * FROM array_op_test WHERE t && '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY 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} diff --git a/src/test/regress/expected/box.out b/src/test/regress/expected/box.out index 02b07dfe61..cd2179f092 100644 --- a/src/test/regress/expected/box.out +++ b/src/test/regress/expected/box.out @@ -154,7 +154,7 @@ SELECT '' AS two, b.f1 -- 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) @@ -165,7 +165,7 @@ SELECT '' AS three, b.f1 -- 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) @@ -196,7 +196,7 @@ SELECT '' AS four, @@(b1.f1) AS p -- 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) diff --git a/src/test/regress/expected/create_index.out b/src/test/regress/expected/create_index.out index 1604d87377..c19794e67e 100644 --- a/src/test/regress/expected/create_index.out +++ b/src/test/regress/expected/create_index.out @@ -164,7 +164,7 @@ SET enable_seqscan = OFF; 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} @@ -186,7 +186,7 @@ SELECT * FROM array_index_op_test WHERE i && '{32}' ORDER BY seqno; 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} @@ -212,7 +212,7 @@ SELECT * FROM array_index_op_test WHERE i && '{17}' ORDER BY seqno; 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} @@ -236,7 +236,7 @@ SELECT * FROM array_index_op_test WHERE i && '{32,17}' ORDER BY seqno; 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} @@ -251,7 +251,7 @@ SELECT * FROM array_index_op_test WHERE i = '{47,77}' ORDER BY seqno; (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} @@ -269,7 +269,7 @@ SELECT * FROM array_index_op_test WHERE t && '{AAAAAAAA72908}' ORDER BY seqno; 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} @@ -285,7 +285,7 @@ SELECT * FROM array_index_op_test WHERE t && '{AAAAAAAAAA646}' ORDER BY seqno; 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} @@ -302,7 +302,7 @@ SELECT * FROM array_index_op_test WHERE t && '{AAAAAAAA72908,AAAAAAAAAA646}' ORD 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} diff --git a/src/test/regress/expected/geometry.out b/src/test/regress/expected/geometry.out index ef8f4ec793..79763f8100 100644 --- a/src/test/regress/expected/geometry.out +++ b/src/test/regress/expected/geometry.out @@ -342,7 +342,7 @@ RESET geqo; -- 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 ------------+------------+---------------------+---------- @@ -372,7 +372,7 @@ SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 ~ p.f1 AS 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 ------------+------------+---------------------+----------- diff --git a/src/test/regress/expected/geometry_1.out b/src/test/regress/expected/geometry_1.out index a60b91301a..81e6b535ef 100644 --- a/src/test/regress/expected/geometry_1.out +++ b/src/test/regress/expected/geometry_1.out @@ -342,7 +342,7 @@ RESET geqo; -- 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 ------------+------------+---------------------+---------- @@ -372,7 +372,7 @@ SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 ~ p.f1 AS 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 ------------+------------+---------------------+----------- diff --git a/src/test/regress/expected/geometry_2.out b/src/test/regress/expected/geometry_2.out index 3b864ffe77..bcc405e8c7 100644 --- a/src/test/regress/expected/geometry_2.out +++ b/src/test/regress/expected/geometry_2.out @@ -342,7 +342,7 @@ RESET geqo; -- 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 ------------+------------+---------------------+---------- @@ -372,7 +372,7 @@ SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 ~ p.f1 AS 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 ------------+------------+---------------------+----------- diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out index 3ded3cc926..8aba9f87b2 100644 --- a/src/test/regress/expected/opr_sanity.out +++ b/src/test/regress/expected/opr_sanity.out @@ -17,25 +17,26 @@ -- 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 @@ -780,8 +781,8 @@ WHERE p1.amopclaid = p3.oid AND p3.opcamid = p2.oid AND -- 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 @@ -831,17 +832,19 @@ ORDER BY 1, 2, 3; 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 diff --git a/src/test/regress/expected/point.out b/src/test/regress/expected/point.out index b77a42b324..552be515d6 100644 --- a/src/test/regress/expected/point.out +++ b/src/test/regress/expected/point.out @@ -67,7 +67,7 @@ SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 ~= '(5.1, 34.5)'; -- 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) @@ -76,7 +76,7 @@ SELECT '' AS three, p.* FROM POINT_TBL p (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) @@ -85,7 +85,7 @@ SELECT '' AS three, p.* FROM POINT_TBL p (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) diff --git a/src/test/regress/expected/polygon.out b/src/test/regress/expected/polygon.out index 3d761e527f..2edda04b4e 100644 --- a/src/test/regress/expected/polygon.out +++ b/src/test/regress/expected/polygon.out @@ -91,7 +91,7 @@ SELECT '' AS zero, 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)'; one | f1 -----+--------------------- | ((3,1),(3,3),(1,0)) @@ -109,7 +109,7 @@ 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)'; one | f1 -----+--------------------- | ((3,1),(3,3),(1,0)) @@ -157,14 +157,14 @@ SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' >> polygon '(3.0,1.0),(3.0,3.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 diff --git a/src/test/regress/sql/arrays.sql b/src/test/regress/sql/arrays.sql index 9c1d659701..ad5f455cf4 100644 --- a/src/test/regress/sql/arrays.sql +++ b/src/test/regress/sql/arrays.sql @@ -157,21 +157,21 @@ SELECT ARRAY[[1,2],[3,4]] || ARRAY[5,6] AS "{{1,2},{3,4},{5,6}}"; 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}"; diff --git a/src/test/regress/sql/box.sql b/src/test/regress/sql/box.sql index 6e5935ceb6..a689295a8b 100644 --- a/src/test/regress/sql/box.sql +++ b/src/test/regress/sql/box.sql @@ -95,12 +95,12 @@ SELECT '' AS two, b.f1 -- 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 @@ -114,7 +114,7 @@ SELECT '' AS four, @@(b1.f1) AS p -- 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; diff --git a/src/test/regress/sql/create_index.sql b/src/test/regress/sql/create_index.sql index 33211e967b..a4bd1db915 100644 --- a/src/test/regress/sql/create_index.sql +++ b/src/test/regress/sql/create_index.sql @@ -143,24 +143,24 @@ 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; 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; diff --git a/src/test/regress/sql/geometry.sql b/src/test/regress/sql/geometry.sql index 4abb679148..c53d9116fa 100644 --- a/src/test/regress/sql/geometry.sql +++ b/src/test/regress/sql/geometry.sql @@ -108,10 +108,10 @@ RESET geqo; -- -- 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 diff --git a/src/test/regress/sql/opr_sanity.sql b/src/test/regress/sql/opr_sanity.sql index 10498a5fa1..8428624582 100644 --- a/src/test/regress/sql/opr_sanity.sql +++ b/src/test/regress/sql/opr_sanity.sql @@ -20,26 +20,27 @@ -- 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 **************** @@ -646,8 +647,8 @@ WHERE p1.amopclaid = p3.oid AND p3.opcamid = p2.oid AND -- 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 diff --git a/src/test/regress/sql/point.sql b/src/test/regress/sql/point.sql index bc45f9f0d8..efbfe6905f 100644 --- a/src/test/regress/sql/point.sql +++ b/src/test/regress/sql/point.sql @@ -43,13 +43,13 @@ SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 ~= '(5.1, 34.5)'; -- 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 diff --git a/src/test/regress/sql/polygon.sql b/src/test/regress/sql/polygon.sql index 5ac3343cb1..1f45de0a6d 100644 --- a/src/test/regress/sql/polygon.sql +++ b/src/test/regress/sql/polygon.sql @@ -68,7 +68,7 @@ SELECT '' AS zero, 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.* @@ -78,7 +78,7 @@ 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 @@ -106,10 +106,10 @@ SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' &> polygon '(3.0,1.0),(3.0,3.0),( 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;