Skip to content

Commit 2f70fdb

Browse files
committed
Remove deprecated containment operators for built-in types
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 <pryzby@telsasoft.com> Discussion: https://www.postgresql.org/message-id/flat/20201027032511.GF9241@telsasoft.com
1 parent 44a184c commit 2f70fdb

File tree

7 files changed

+3
-102
lines changed

7 files changed

+3
-102
lines changed

doc/src/sgml/func.sgml

-9
Original file line numberDiff line numberDiff line change
@@ -10890,15 +10890,6 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
1089010890
</para>
1089110891
</caution>
1089210892

10893-
<note>
10894-
<para>
10895-
Before <productname>PostgreSQL</productname> 8.2, the containment
10896-
operators <literal>@&gt;</literal> and <literal>&lt;@</literal> were respectively
10897-
called <literal>~</literal> and <literal>@</literal>. These names are still
10898-
available, but are deprecated and will eventually be removed.
10899-
</para>
10900-
</note>
10901-
1090210893
<table id="functions-geometry-func-table">
1090310894
<title>Geometric Functions</title>
1090410895
<tgroup cols="1">

src/include/catalog/catversion.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 202011013
56+
#define CATALOG_VERSION_NO 202011031
5757

5858
#endif

src/include/catalog/pg_amop.dat

-18
Original file line numberDiff line numberDiff line change
@@ -1100,10 +1100,6 @@
11001100
amopstrategy => '11', amopopr => '|>>(box,box)', amopmethod => 'gist' },
11011101
{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box',
11021102
amopstrategy => '12', amopopr => '|&>(box,box)', amopmethod => 'gist' },
1103-
{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box',
1104-
amopstrategy => '13', amopopr => '~(box,box)', amopmethod => 'gist' },
1105-
{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box',
1106-
amopstrategy => '14', amopopr => '@(box,box)', amopmethod => 'gist' },
11071103
{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'point',
11081104
amopstrategy => '15', amoppurpose => 'o', amopopr => '<->(box,point)',
11091105
amopmethod => 'gist', amopsortfamily => 'btree/float_ops' },
@@ -1175,12 +1171,6 @@
11751171
{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon',
11761172
amoprighttype => 'polygon', amopstrategy => '12',
11771173
amopopr => '|&>(polygon,polygon)', amopmethod => 'gist' },
1178-
{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon',
1179-
amoprighttype => 'polygon', amopstrategy => '13',
1180-
amopopr => '~(polygon,polygon)', amopmethod => 'gist' },
1181-
{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon',
1182-
amoprighttype => 'polygon', amopstrategy => '14',
1183-
amopopr => '@(polygon,polygon)', amopmethod => 'gist' },
11841174
{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon',
11851175
amoprighttype => 'point', amopstrategy => '15', amoppurpose => 'o',
11861176
amopopr => '<->(polygon,point)', amopmethod => 'gist',
@@ -1223,12 +1213,6 @@
12231213
{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle',
12241214
amoprighttype => 'circle', amopstrategy => '12',
12251215
amopopr => '|&>(circle,circle)', amopmethod => 'gist' },
1226-
{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle',
1227-
amoprighttype => 'circle', amopstrategy => '13',
1228-
amopopr => '~(circle,circle)', amopmethod => 'gist' },
1229-
{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle',
1230-
amoprighttype => 'circle', amopstrategy => '14',
1231-
amopopr => '@(circle,circle)', amopmethod => 'gist' },
12321216
{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle',
12331217
amoprighttype => 'point', amopstrategy => '15', amoppurpose => 'o',
12341218
amopopr => '<->(circle,point)', amopmethod => 'gist',
@@ -2454,8 +2438,6 @@
24542438
amoprighttype => 'box', amopstrategy => '12', amopopr => '|&>(box,box)',
24552439
amopmethod => 'brin' },
24562440

2457-
# we could, but choose not to, supply entries for strategies 13 and 14
2458-
24592441
{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box',
24602442
amoprighttype => 'point', amopstrategy => '7', amopopr => '@>(box,point)',
24612443
amopmethod => 'brin' },

src/include/catalog/pg_operator.dat

-65
Original file line numberDiff line numberDiff line change
@@ -2777,71 +2777,6 @@
27772777
oprname => '||', oprleft => 'anynonarray', oprright => 'text',
27782778
oprresult => 'text', oprcode => 'anytextcat' },
27792779

2780-
# obsolete names for contains/contained-by operators; remove these someday
2781-
{ oid => '2860', descr => 'deprecated, use <@ instead',
2782-
oprname => '@', oprleft => 'polygon', oprright => 'polygon',
2783-
oprresult => 'bool', oprcom => '~(polygon,polygon)',
2784-
oprcode => 'poly_contained', oprrest => 'contsel', oprjoin => 'contjoinsel' },
2785-
{ oid => '2861', descr => 'deprecated, use @> instead',
2786-
oprname => '~', oprleft => 'polygon', oprright => 'polygon',
2787-
oprresult => 'bool', oprcom => '@(polygon,polygon)',
2788-
oprcode => 'poly_contain', oprrest => 'contsel', oprjoin => 'contjoinsel' },
2789-
{ oid => '2862', descr => 'deprecated, use <@ instead',
2790-
oprname => '@', oprleft => 'box', oprright => 'box', oprresult => 'bool',
2791-
oprcom => '~(box,box)', oprcode => 'box_contained', oprrest => 'contsel',
2792-
oprjoin => 'contjoinsel' },
2793-
{ oid => '2863', descr => 'deprecated, use @> instead',
2794-
oprname => '~', oprleft => 'box', oprright => 'box', oprresult => 'bool',
2795-
oprcom => '@(box,box)', oprcode => 'box_contain', oprrest => 'contsel',
2796-
oprjoin => 'contjoinsel' },
2797-
{ oid => '2864', descr => 'deprecated, use <@ instead',
2798-
oprname => '@', oprleft => 'circle', oprright => 'circle',
2799-
oprresult => 'bool', oprcom => '~(circle,circle)',
2800-
oprcode => 'circle_contained', oprrest => 'contsel',
2801-
oprjoin => 'contjoinsel' },
2802-
{ oid => '2865', descr => 'deprecated, use @> instead',
2803-
oprname => '~', oprleft => 'circle', oprright => 'circle',
2804-
oprresult => 'bool', oprcom => '@(circle,circle)',
2805-
oprcode => 'circle_contain', oprrest => 'contsel', oprjoin => 'contjoinsel' },
2806-
{ oid => '2866', descr => 'deprecated, use <@ instead',
2807-
oprname => '@', oprleft => 'point', oprright => 'box', oprresult => 'bool',
2808-
oprcode => 'on_pb' },
2809-
{ oid => '2867', descr => 'deprecated, use <@ instead',
2810-
oprname => '@', oprleft => 'point', oprright => 'path', oprresult => 'bool',
2811-
oprcom => '~(path,point)', oprcode => 'on_ppath' },
2812-
{ oid => '2868', descr => 'deprecated, use @> instead',
2813-
oprname => '~', oprleft => 'path', oprright => 'point', oprresult => 'bool',
2814-
oprcom => '@(point,path)', oprcode => 'path_contain_pt' },
2815-
{ oid => '2869', descr => 'deprecated, use <@ instead',
2816-
oprname => '@', oprleft => 'point', oprright => 'polygon',
2817-
oprresult => 'bool', oprcom => '~(polygon,point)',
2818-
oprcode => 'pt_contained_poly' },
2819-
{ oid => '2870', descr => 'deprecated, use @> instead',
2820-
oprname => '~', oprleft => 'polygon', oprright => 'point',
2821-
oprresult => 'bool', oprcom => '@(point,polygon)',
2822-
oprcode => 'poly_contain_pt' },
2823-
{ oid => '2871', descr => 'deprecated, use <@ instead',
2824-
oprname => '@', oprleft => 'point', oprright => 'circle', oprresult => 'bool',
2825-
oprcom => '~(circle,point)', oprcode => 'pt_contained_circle' },
2826-
{ oid => '2872', descr => 'deprecated, use @> instead',
2827-
oprname => '~', oprleft => 'circle', oprright => 'point', oprresult => 'bool',
2828-
oprcom => '@(point,circle)', oprcode => 'circle_contain_pt' },
2829-
{ oid => '2873', descr => 'deprecated, use <@ instead',
2830-
oprname => '@', oprleft => 'point', oprright => 'line', oprresult => 'bool',
2831-
oprcode => 'on_pl' },
2832-
{ oid => '2874', descr => 'deprecated, use <@ instead',
2833-
oprname => '@', oprleft => 'point', oprright => 'lseg', oprresult => 'bool',
2834-
oprcode => 'on_ps' },
2835-
{ oid => '2875', descr => 'deprecated, use <@ instead',
2836-
oprname => '@', oprleft => 'lseg', oprright => 'line', oprresult => 'bool',
2837-
oprcode => 'on_sl' },
2838-
{ oid => '2876', descr => 'deprecated, use <@ instead',
2839-
oprname => '@', oprleft => 'lseg', oprright => 'box', oprresult => 'bool',
2840-
oprcode => 'on_sb' },
2841-
{ oid => '2877', descr => 'deprecated, use @> instead',
2842-
oprname => '~', oprleft => '_aclitem', oprright => 'aclitem',
2843-
oprresult => 'bool', oprcode => 'aclcontains' },
2844-
28452780
# uuid operators
28462781
{ oid => '2972', descr => 'equal',
28472782
oprname => '=', oprcanmerge => 't', oprcanhash => 't', oprleft => 'uuid',

src/test/regress/expected/create_am.out

-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ CREATE OPERATOR CLASS box_ops DEFAULT
2727
OPERATOR 10 <<|,
2828
OPERATOR 11 |>>,
2929
OPERATOR 12 |&>,
30-
OPERATOR 13 ~,
31-
OPERATOR 14 @,
3230
FUNCTION 1 gist_box_consistent(internal, box, smallint, oid, internal),
3331
FUNCTION 2 gist_box_union(internal, internal),
3432
-- don't need compress, decompress, or fetch functions

src/test/regress/expected/opr_sanity.out

+2-5
Original file line numberDiff line numberDiff line change
@@ -1163,14 +1163,13 @@ ORDER BY 1, 2;
11631163
?-| | ?-|
11641164
?| | ?|
11651165
?|| | ?||
1166-
@ | ~
11671166
@@ | @@
11681167
@@@ | @@@
11691168
| | |
11701169
~<=~ | ~>=~
11711170
~<~ | ~>~
11721171
~= | ~=
1173-
(30 rows)
1172+
(29 rows)
11741173

11751174
-- Likewise for negator pairs.
11761175
SELECT DISTINCT o1.oprname AS op1, o2.oprname AS op2
@@ -1990,8 +1989,6 @@ ORDER BY 1, 2, 3;
19901989
783 | 11 | >^
19911990
783 | 11 | |>>
19921991
783 | 12 | |&>
1993-
783 | 13 | ~
1994-
783 | 14 | @
19951992
783 | 15 | <->
19961993
783 | 16 | @>
19971994
783 | 18 | =
@@ -2084,7 +2081,7 @@ ORDER BY 1, 2, 3;
20842081
4000 | 26 | >>
20852082
4000 | 27 | >>=
20862083
4000 | 28 | ^@
2087-
(125 rows)
2084+
(123 rows)
20882085

20892086
-- Check that all opclass search operators have selectivity estimators.
20902087
-- This is not absolutely required, but it seems a reasonable thing

src/test/regress/sql/create_am.sql

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ CREATE OPERATOR CLASS box_ops DEFAULT
2828
OPERATOR 10 <<|,
2929
OPERATOR 11 |>>,
3030
OPERATOR 12 |&>,
31-
OPERATOR 13 ~,
32-
OPERATOR 14 @,
3331
FUNCTION 1 gist_box_consistent(internal, box, smallint, oid, internal),
3432
FUNCTION 2 gist_box_union(internal, internal),
3533
-- don't need compress, decompress, or fetch functions

0 commit comments

Comments
 (0)