Remove deprecated containment operators for built-in types
authorPeter Eisentraut <[email protected]>
Tue, 3 Nov 2020 09:32:20 +0000 (10:32 +0100)
committerPeter Eisentraut <[email protected]>
Tue, 3 Nov 2020 09:43:12 +0000 (10:43 +0100)
Remove old containment operators @ and ~ for built-in geometry data
types.  These have been deprecated; use <@ and @> instead.

(Some contrib modules still contain the same deprecated operators.
That will be dealt with separately.)

Author: Justin Pryzby <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/20201027032511[email protected]

doc/src/sgml/func.sgml
src/include/catalog/catversion.h
src/include/catalog/pg_amop.dat
src/include/catalog/pg_operator.dat
src/test/regress/expected/create_am.out
src/test/regress/expected/opr_sanity.out
src/test/regress/sql/create_am.sql

index bf6004f321f6350d5055f8922dda1040f6897426..ee721d258e00489d9ae84155b47239c0af8b1414 100644 (file)
@@ -10890,15 +10890,6 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
     </para>
    </caution>
 
-   <note>
-    <para>
-     Before <productname>PostgreSQL</productname> 8.2, the containment
-     operators <literal>@&gt;</literal> and <literal>&lt;@</literal> were respectively
-     called <literal>~</literal> and <literal>@</literal>.  These names are still
-     available, but are deprecated and will eventually be removed.
-    </para>
-   </note>
-
    <table id="functions-geometry-func-table">
     <title>Geometric Functions</title>
     <tgroup cols="1">
index f28f083aca7bd502e227d30c1ff3e44f0487c8d4..100e6f0a09a9c0a0b4dac041894ee4629696e745 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                         yyyymmddN */
-#define CATALOG_VERSION_NO 202011013
+#define CATALOG_VERSION_NO 202011031
 
 #endif
index 1dfb6fd37394855300bb06ad9e0407901ed1f961..bbe357fbc0e8b4533de0f50d3cc35dc85450b9cd 100644 (file)
   amopstrategy => '11', amopopr => '|>>(box,box)', amopmethod => 'gist' },
 { amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box',
   amopstrategy => '12', amopopr => '|&>(box,box)', amopmethod => 'gist' },
-{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box',
-  amopstrategy => '13', amopopr => '~(box,box)', amopmethod => 'gist' },
-{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box',
-  amopstrategy => '14', amopopr => '@(box,box)', amopmethod => 'gist' },
 { amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'point',
   amopstrategy => '15', amoppurpose => 'o', amopopr => '<->(box,point)',
   amopmethod => 'gist', amopsortfamily => 'btree/float_ops' },
 { amopfamily => 'gist/poly_ops', amoplefttype => 'polygon',
   amoprighttype => 'polygon', amopstrategy => '12',
   amopopr => '|&>(polygon,polygon)', amopmethod => 'gist' },
-{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon',
-  amoprighttype => 'polygon', amopstrategy => '13',
-  amopopr => '~(polygon,polygon)', amopmethod => 'gist' },
-{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon',
-  amoprighttype => 'polygon', amopstrategy => '14',
-  amopopr => '@(polygon,polygon)', amopmethod => 'gist' },
 { amopfamily => 'gist/poly_ops', amoplefttype => 'polygon',
   amoprighttype => 'point', amopstrategy => '15', amoppurpose => 'o',
   amopopr => '<->(polygon,point)', amopmethod => 'gist',
 { amopfamily => 'gist/circle_ops', amoplefttype => 'circle',
   amoprighttype => 'circle', amopstrategy => '12',
   amopopr => '|&>(circle,circle)', amopmethod => 'gist' },
-{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle',
-  amoprighttype => 'circle', amopstrategy => '13',
-  amopopr => '~(circle,circle)', amopmethod => 'gist' },
-{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle',
-  amoprighttype => 'circle', amopstrategy => '14',
-  amopopr => '@(circle,circle)', amopmethod => 'gist' },
 { amopfamily => 'gist/circle_ops', amoplefttype => 'circle',
   amoprighttype => 'point', amopstrategy => '15', amoppurpose => 'o',
   amopopr => '<->(circle,point)', amopmethod => 'gist',
   amoprighttype => 'box', amopstrategy => '12', amopopr => '|&>(box,box)',
   amopmethod => 'brin' },
 
-# we could, but choose not to, supply entries for strategies 13 and 14
-
 { amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box',
   amoprighttype => 'point', amopstrategy => '7', amopopr => '@>(box,point)',
   amopmethod => 'brin' },
index 7cc812adda638d8e9c26ee5364b7ebcb006dbfc1..feb8edece5508a81d0396a071a2a6a56225e635a 100644 (file)
   oprname => '||', oprleft => 'anynonarray', oprright => 'text',
   oprresult => 'text', oprcode => 'anytextcat' },
 
-# obsolete names for contains/contained-by operators; remove these someday
-{ oid => '2860', descr => 'deprecated, use <@ instead',
-  oprname => '@', oprleft => 'polygon', oprright => 'polygon',
-  oprresult => 'bool', oprcom => '~(polygon,polygon)',
-  oprcode => 'poly_contained', oprrest => 'contsel', oprjoin => 'contjoinsel' },
-{ oid => '2861', descr => 'deprecated, use @> instead',
-  oprname => '~', oprleft => 'polygon', oprright => 'polygon',
-  oprresult => 'bool', oprcom => '@(polygon,polygon)',
-  oprcode => 'poly_contain', oprrest => 'contsel', oprjoin => 'contjoinsel' },
-{ oid => '2862', descr => 'deprecated, use <@ instead',
-  oprname => '@', oprleft => 'box', oprright => 'box', oprresult => 'bool',
-  oprcom => '~(box,box)', oprcode => 'box_contained', oprrest => 'contsel',
-  oprjoin => 'contjoinsel' },
-{ oid => '2863', descr => 'deprecated, use @> instead',
-  oprname => '~', oprleft => 'box', oprright => 'box', oprresult => 'bool',
-  oprcom => '@(box,box)', oprcode => 'box_contain', oprrest => 'contsel',
-  oprjoin => 'contjoinsel' },
-{ oid => '2864', descr => 'deprecated, use <@ instead',
-  oprname => '@', oprleft => 'circle', oprright => 'circle',
-  oprresult => 'bool', oprcom => '~(circle,circle)',
-  oprcode => 'circle_contained', oprrest => 'contsel',
-  oprjoin => 'contjoinsel' },
-{ oid => '2865', descr => 'deprecated, use @> instead',
-  oprname => '~', oprleft => 'circle', oprright => 'circle',
-  oprresult => 'bool', oprcom => '@(circle,circle)',
-  oprcode => 'circle_contain', oprrest => 'contsel', oprjoin => 'contjoinsel' },
-{ oid => '2866', descr => 'deprecated, use <@ instead',
-  oprname => '@', oprleft => 'point', oprright => 'box', oprresult => 'bool',
-  oprcode => 'on_pb' },
-{ oid => '2867', descr => 'deprecated, use <@ instead',
-  oprname => '@', oprleft => 'point', oprright => 'path', oprresult => 'bool',
-  oprcom => '~(path,point)', oprcode => 'on_ppath' },
-{ oid => '2868', descr => 'deprecated, use @> instead',
-  oprname => '~', oprleft => 'path', oprright => 'point', oprresult => 'bool',
-  oprcom => '@(point,path)', oprcode => 'path_contain_pt' },
-{ oid => '2869', descr => 'deprecated, use <@ instead',
-  oprname => '@', oprleft => 'point', oprright => 'polygon',
-  oprresult => 'bool', oprcom => '~(polygon,point)',
-  oprcode => 'pt_contained_poly' },
-{ oid => '2870', descr => 'deprecated, use @> instead',
-  oprname => '~', oprleft => 'polygon', oprright => 'point',
-  oprresult => 'bool', oprcom => '@(point,polygon)',
-  oprcode => 'poly_contain_pt' },
-{ oid => '2871', descr => 'deprecated, use <@ instead',
-  oprname => '@', oprleft => 'point', oprright => 'circle', oprresult => 'bool',
-  oprcom => '~(circle,point)', oprcode => 'pt_contained_circle' },
-{ oid => '2872', descr => 'deprecated, use @> instead',
-  oprname => '~', oprleft => 'circle', oprright => 'point', oprresult => 'bool',
-  oprcom => '@(point,circle)', oprcode => 'circle_contain_pt' },
-{ oid => '2873', descr => 'deprecated, use <@ instead',
-  oprname => '@', oprleft => 'point', oprright => 'line', oprresult => 'bool',
-  oprcode => 'on_pl' },
-{ oid => '2874', descr => 'deprecated, use <@ instead',
-  oprname => '@', oprleft => 'point', oprright => 'lseg', oprresult => 'bool',
-  oprcode => 'on_ps' },
-{ oid => '2875', descr => 'deprecated, use <@ instead',
-  oprname => '@', oprleft => 'lseg', oprright => 'line', oprresult => 'bool',
-  oprcode => 'on_sl' },
-{ oid => '2876', descr => 'deprecated, use <@ instead',
-  oprname => '@', oprleft => 'lseg', oprright => 'box', oprresult => 'bool',
-  oprcode => 'on_sb' },
-{ oid => '2877', descr => 'deprecated, use @> instead',
-  oprname => '~', oprleft => '_aclitem', oprright => 'aclitem',
-  oprresult => 'bool', oprcode => 'aclcontains' },
-
 # uuid operators
 { oid => '2972', descr => 'equal',
   oprname => '=', oprcanmerge => 't', oprcanhash => 't', oprleft => 'uuid',
index 730011526a8efcf46a7f62602786759c9a3e9f93..0dfb26c30143d901121627ec82fa5b3954fa7bfa 100644 (file)
@@ -27,8 +27,6 @@ CREATE OPERATOR CLASS box_ops DEFAULT
    OPERATOR 10 <<|,
    OPERATOR 11 |>>,
    OPERATOR 12 |&>,
-   OPERATOR 13 ~,
-   OPERATOR 14 @,
    FUNCTION 1  gist_box_consistent(internal, box, smallint, oid, internal),
    FUNCTION 2  gist_box_union(internal, internal),
    -- don't need compress, decompress, or fetch functions
index 7825a765cd7bf7461b91d3b422983a01ff0f1ff3..7ed29b49617b50d99f85f7db6c53494b67fde21f 100644 (file)
@@ -1163,14 +1163,13 @@ ORDER BY 1, 2;
  ?-|  | ?-|
  ?|   | ?|
  ?||  | ?||
- @    | ~
  @@   | @@
  @@@  | @@@
  |    | |
  ~<=~ | ~>=~
  ~<~  | ~>~
  ~=   | ~=
-(30 rows)
+(29 rows)
 
 -- Likewise for negator pairs.
 SELECT DISTINCT o1.oprname AS op1, o2.oprname AS op2
@@ -1990,8 +1989,6 @@ ORDER BY 1, 2, 3;
         783 |           11 | >^
         783 |           11 | |>>
         783 |           12 | |&>
-        783 |           13 | ~
-        783 |           14 | @
         783 |           15 | <->
         783 |           16 | @>
         783 |           18 | =
@@ -2084,7 +2081,7 @@ ORDER BY 1, 2, 3;
        4000 |           26 | >>
        4000 |           27 | >>=
        4000 |           28 | ^@
-(125 rows)
+(123 rows)
 
 -- Check that all opclass search operators have selectivity estimators.
 -- This is not absolutely required, but it seems a reasonable thing
index 6dd0de4272606e55e741b70eb0773e2f97b181a9..9a359466ce49923f9026f3e46d14d28e290aaa22 100644 (file)
@@ -28,8 +28,6 @@ CREATE OPERATOR CLASS box_ops DEFAULT
    OPERATOR 10 <<|,
    OPERATOR 11 |>>,
    OPERATOR 12 |&>,
-   OPERATOR 13 ~,
-   OPERATOR 14 @,
    FUNCTION 1  gist_box_consistent(internal, box, smallint, oid, internal),
    FUNCTION 2  gist_box_union(internal, internal),
    -- don't need compress, decompress, or fetch functions