From d63ae3d4af80c1287ec9a68b40c38368ab4255e3 Mon Sep 17 00:00:00 2001
From: Pavel Borisov <pashkin.elfe@gmail.com>
Date: Wed, 4 Nov 2020 10:19:33 +0400
Subject: [PATCH v5] Deprecate and replace <^ and >^ operators for points.

The operators to check one point being strictly above or below the
other were mistakenly using <^ and >^ symbols which has a different
meaning for boxes i.e. they allow the boxes edges to touch.

This patch introduces <<| and |>> and deprecates <^ and >^ operators
for points (with the meaning of strictly above/below). The goal is for
the same operators have similar meaning in different data types.

Author: Emre Hasegeli <emre@hasegeli.com>
Reviewed-by: Pavel Borisov <pashkin.elfe@gmail.com>

Discussion: https://www.postgresql.org/message-id/24348.1587444160@sss.pgh.pa.us
---
 doc/src/sgml/func.sgml                        | 34 +--------
 doc/src/sgml/gist.sgml                        |  4 +-
 doc/src/sgml/spgist.sgml                      |  8 +-
 src/include/catalog/pg_amop.dat               | 12 +--
 src/include/catalog/pg_operator.dat           | 13 +++-
 src/test/regress/expected/create_index.out    | 16 ++--
 .../regress/expected/create_index_spgist.out  | 76 +++++++++----------
 src/test/regress/expected/opr_sanity.out      |  6 +-
 src/test/regress/sql/create_index.sql         | 12 +--
 src/test/regress/sql/create_index_spgist.sql  | 36 ++++-----
 10 files changed, 96 insertions(+), 121 deletions(-)

diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 87a6ba8d10..23029df942 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -10622,7 +10622,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
        </para>
        <para>
         Is first object strictly below second?
-        Available for <type>box</type>, <type>polygon</type>,
+        Available for <type>point</type>, <type>box</type>, <type>polygon</type>,
         <type>circle</type>.
        </para>
        <para>
@@ -10638,7 +10638,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
        </para>
        <para>
         Is first object strictly above second?
-        Available for <type>box</type>, <type>polygon</type>,
+        Available for <type>point</type>, <type>box</type>, <type>polygon</type>,
         <type>circle</type>.
        </para>
        <para>
@@ -10693,21 +10693,6 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
        </para></entry>
       </row>
 
-      <row>
-       <entry role="func_table_entry"><para role="func_signature">
-        <type>point</type> <literal>&lt;^</literal> <type>point</type>
-        <returnvalue>boolean</returnvalue>
-       </para>
-       <para>
-        Is first object strictly below second?
-        (This operator is misnamed; it should be <literal>&lt;&lt;|</literal>.)
-       </para>
-       <para>
-        <literal>point '(1,0)' &lt;^ point '(1,1)'</literal>
-        <returnvalue>t</returnvalue>
-       </para></entry>
-      </row>
-
       <row>
        <entry role="func_table_entry"><para role="func_signature">
         <type>box</type> <literal>&gt;^</literal> <type>box</type>
@@ -10722,21 +10707,6 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
        </para></entry>
       </row>
 
-      <row>
-       <entry role="func_table_entry"><para role="func_signature">
-        <type>point</type> <literal>&gt;^</literal> <type>point</type>
-        <returnvalue>boolean</returnvalue>
-       </para>
-       <para>
-        Is first object strictly above second?
-        (This operator is misnamed; it should be <literal>|&gt;&gt;</literal>.)
-       </para>
-       <para>
-        <literal>point '(1,1)' &gt;^ point '(1,0)'</literal>
-        <returnvalue>t</returnvalue>
-       </para></entry>
-      </row>
-
       <row>
        <entry role="func_table_entry"><para role="func_signature">
         <replaceable>geometric_type</replaceable> <literal>?#</literal> <replaceable>geometric_type</replaceable>
diff --git a/doc/src/sgml/gist.sgml b/doc/src/sgml/gist.sgml
index 1bf5f09659..d1b6cc9a01 100644
--- a/doc/src/sgml/gist.sgml
+++ b/doc/src/sgml/gist.sgml
@@ -118,12 +118,12 @@
 
      <row>
       <entry valign="middle" morerows="7"><literal>point_ops</literal></entry>
-      <entry><literal>&gt;^ (point,point)</literal></entry>
+      <entry><literal>|&gt;&gt; (point,point)</literal></entry>
       <entry valign="middle" morerows="7"><literal>&lt;-&gt; (point,point)</literal></entry>
      </row>
      <row><entry><literal>&lt;&lt; (point,point)</literal></entry></row>
      <row><entry><literal>&gt;&gt; (point,point)</literal></entry></row>
-     <row><entry><literal>&lt;^ (point,point)</literal></entry></row>
+     <row><entry><literal>&lt;&lt;| (point,point)</literal></entry></row>
      <row><entry><literal>~= (point,point)</literal></entry></row>
      <row><entry><literal>&lt;@ (point,box)</literal></entry></row>
      <row><entry><literal>&lt;@ (point,polygon)</literal></entry></row>
diff --git a/doc/src/sgml/spgist.sgml b/doc/src/sgml/spgist.sgml
index 68d09951d9..5d7ff27fe4 100644
--- a/doc/src/sgml/spgist.sgml
+++ b/doc/src/sgml/spgist.sgml
@@ -92,12 +92,12 @@
 
      <row>
       <entry valign="middle" morerows="5"><literal>kd_point_ops</literal></entry>
-      <entry><literal>&gt;^ (point,point)</literal></entry>
+      <entry><literal>|&gt;&gt; (point,point)</literal></entry>
       <entry valign="middle" morerows="5"><literal>&lt;-&gt; (point,point)</literal></entry>
      </row>
      <row><entry><literal>&lt;&lt; (point,point)</literal></entry></row>
      <row><entry><literal>&gt;&gt; (point,point)</literal></entry></row>
-     <row><entry><literal>&lt;^ (point,point)</literal></entry></row>
+     <row><entry><literal>&lt;&lt;| (point,point)</literal></entry></row>
      <row><entry><literal>~= (point,point)</literal></entry></row>
      <row><entry><literal>&lt;@ (point,box)</literal></entry></row>
 
@@ -136,12 +136,12 @@
 
      <row>
       <entry valign="middle" morerows="5"><literal>quad_point_ops</literal></entry>
-      <entry><literal>&gt;^ (point,point)</literal></entry>
+      <entry><literal>|&gt;&gt; (point,point)</literal></entry>
       <entry valign="middle" morerows="5"><literal>&lt;-&gt; (point,point)</literal></entry>
      </row>
      <row><entry><literal>&lt;&lt; (point,point)</literal></entry></row>
      <row><entry><literal>&gt;&gt; (point,point)</literal></entry></row>
-     <row><entry><literal>&lt;^ (point,point)</literal></entry></row>
+     <row><entry><literal>&lt;&lt;| (point,point)</literal></entry></row>
      <row><entry><literal>~= (point,point)</literal></entry></row>
      <row><entry><literal>&lt;@ (point,box)</literal></entry></row>
 
diff --git a/src/include/catalog/pg_amop.dat b/src/include/catalog/pg_amop.dat
index bbe357fbc0..676d157eb1 100644
--- a/src/include/catalog/pg_amop.dat
+++ b/src/include/catalog/pg_amop.dat
@@ -1106,7 +1106,7 @@
 
 # gist point_ops
 { amopfamily => 'gist/point_ops', amoplefttype => 'point',
-  amoprighttype => 'point', amopstrategy => '11', amopopr => '>^(point,point)',
+  amoprighttype => 'point', amopstrategy => '11', amopopr => '|>>(point,point)',
   amopmethod => 'gist' },
 { amopfamily => 'gist/point_ops', amoplefttype => 'point',
   amoprighttype => 'point', amopstrategy => '1', amopopr => '<<(point,point)',
@@ -1115,7 +1115,7 @@
   amoprighttype => 'point', amopstrategy => '5', amopopr => '>>(point,point)',
   amopmethod => 'gist' },
 { amopfamily => 'gist/point_ops', amoplefttype => 'point',
-  amoprighttype => 'point', amopstrategy => '10', amopopr => '<^(point,point)',
+  amoprighttype => 'point', amopstrategy => '10', amopopr => '<<|(point,point)',
   amopmethod => 'gist' },
 { amopfamily => 'gist/point_ops', amoplefttype => 'point',
   amoprighttype => 'point', amopstrategy => '6', amopopr => '~=(point,point)',
@@ -1365,7 +1365,7 @@
 
 # SP-GiST quad_point_ops
 { amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point',
-  amoprighttype => 'point', amopstrategy => '11', amopopr => '>^(point,point)',
+  amoprighttype => 'point', amopstrategy => '11', amopopr => '|>>(point,point)',
   amopmethod => 'spgist' },
 { amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point',
   amoprighttype => 'point', amopstrategy => '1', amopopr => '<<(point,point)',
@@ -1374,7 +1374,7 @@
   amoprighttype => 'point', amopstrategy => '5', amopopr => '>>(point,point)',
   amopmethod => 'spgist' },
 { amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point',
-  amoprighttype => 'point', amopstrategy => '10', amopopr => '<^(point,point)',
+  amoprighttype => 'point', amopstrategy => '10', amopopr => '<<|(point,point)',
   amopmethod => 'spgist' },
 { amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point',
   amoprighttype => 'point', amopstrategy => '6', amopopr => '~=(point,point)',
@@ -1389,7 +1389,7 @@
 
 # SP-GiST kd_point_ops
 { amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point',
-  amoprighttype => 'point', amopstrategy => '11', amopopr => '>^(point,point)',
+  amoprighttype => 'point', amopstrategy => '11', amopopr => '|>>(point,point)',
   amopmethod => 'spgist' },
 { amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point',
   amoprighttype => 'point', amopstrategy => '1', amopopr => '<<(point,point)',
@@ -1398,7 +1398,7 @@
   amoprighttype => 'point', amopstrategy => '5', amopopr => '>>(point,point)',
   amopmethod => 'spgist' },
 { amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point',
-  amoprighttype => 'point', amopstrategy => '10', amopopr => '<^(point,point)',
+  amoprighttype => 'point', amopstrategy => '10', amopopr => '<<|(point,point)',
   amopmethod => 'spgist' },
 { amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point',
   amoprighttype => 'point', amopstrategy => '6', amopopr => '~=(point,point)',
diff --git a/src/include/catalog/pg_operator.dat b/src/include/catalog/pg_operator.dat
index feb8edece5..9c8f60e871 100644
--- a/src/include/catalog/pg_operator.dat
+++ b/src/include/catalog/pg_operator.dat
@@ -394,7 +394,7 @@
   oprname => '<=', oprleft => 'box', oprright => 'box', oprresult => 'bool',
   oprcom => '>=(box,box)', oprnegate => '>(box,box)', oprcode => 'box_le',
   oprrest => 'areasel', oprjoin => 'areajoinsel' },
-{ oid => '506', descr => 'is above',
+{ oid => '506', descr => 'deprecated, use |>> instead',
   oprname => '>^', oprleft => 'point', oprright => 'point', oprresult => 'bool',
   oprcode => 'point_above', oprrest => 'positionsel',
   oprjoin => 'positionjoinsel' },
@@ -406,7 +406,7 @@
   oprname => '>>', oprleft => 'point', oprright => 'point', oprresult => 'bool',
   oprcode => 'point_right', oprrest => 'positionsel',
   oprjoin => 'positionjoinsel' },
-{ oid => '509', descr => 'is below',
+{ oid => '509', descr => 'deprecated, use <<| instead',
   oprname => '<^', oprleft => 'point', oprright => 'point', oprresult => 'bool',
   oprcode => 'point_below', oprrest => 'positionsel',
   oprjoin => 'positionjoinsel' },
@@ -1877,6 +1877,15 @@
   oprname => '#', oprleft => 'line', oprright => 'line', oprresult => 'point',
   oprcom => '#(line,line)', oprcode => 'line_interpt' },
 
+{ oid => '4388', descr => 'is below',
+  oprname => '<<|', oprleft => 'point', oprright => 'point', oprresult => 'bool',
+  oprcode => 'point_below', oprrest => 'positionsel',
+  oprjoin => 'positionjoinsel' },
+{ oid => '4389', descr => 'is above',
+  oprname => '|>>', oprleft => 'point', oprright => 'point', oprresult => 'bool',
+  oprcode => 'point_above', oprrest => 'positionsel',
+  oprjoin => 'positionjoinsel' },
+
 # MACADDR type
 { oid => '1220', descr => 'equal',
   oprname => '=', oprcanmerge => 't', oprcanhash => 't', oprleft => 'macaddr',
diff --git a/src/test/regress/expected/create_index.out b/src/test/regress/expected/create_index.out
index 93a8736a3f..792777b27e 100644
--- a/src/test/regress/expected/create_index.out
+++ b/src/test/regress/expected/create_index.out
@@ -160,13 +160,13 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)';
      3
 (1 row)
 
-SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)';
+SELECT count(*) FROM point_tbl p WHERE p.f1 <<| '(0.0, 0.0)';
  count 
 -------
      1
 (1 row)
 
-SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)';
+SELECT count(*) FROM point_tbl p WHERE p.f1 |>> '(0.0, 0.0)';
  count 
 -------
      4
@@ -468,30 +468,30 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)';
 (1 row)
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)';
+SELECT count(*) FROM point_tbl p WHERE p.f1 <<| '(0.0, 0.0)';
                       QUERY PLAN                      
 ------------------------------------------------------
  Aggregate
    ->  Index Only Scan using gpointind on point_tbl p
-         Index Cond: (f1 <^ '(0,0)'::point)
+         Index Cond: (f1 <<| '(0,0)'::point)
 (3 rows)
 
-SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)';
+SELECT count(*) FROM point_tbl p WHERE p.f1 <<| '(0.0, 0.0)';
  count 
 -------
      1
 (1 row)
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)';
+SELECT count(*) FROM point_tbl p WHERE p.f1 |>> '(0.0, 0.0)';
                       QUERY PLAN                      
 ------------------------------------------------------
  Aggregate
    ->  Index Only Scan using gpointind on point_tbl p
-         Index Cond: (f1 >^ '(0,0)'::point)
+         Index Cond: (f1 |>> '(0,0)'::point)
 (3 rows)
 
-SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)';
+SELECT count(*) FROM point_tbl p WHERE p.f1 |>> '(0.0, 0.0)';
  count 
 -------
      4
diff --git a/src/test/regress/expected/create_index_spgist.out b/src/test/regress/expected/create_index_spgist.out
index 1dd110dfc5..afe38e16a2 100644
--- a/src/test/regress/expected/create_index_spgist.out
+++ b/src/test/regress/expected/create_index_spgist.out
@@ -62,13 +62,13 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
   4999
 (1 row)
 
-SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
  count 
 -------
   5000
 (1 row)
 
-SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
  count 
 -------
   5999
@@ -282,30 +282,30 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
 (1 row)
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
                         QUERY PLAN                         
 -----------------------------------------------------------
  Aggregate
    ->  Index Only Scan using sp_quad_ind on quad_point_tbl
-         Index Cond: (p <^ '(5000,4000)'::point)
+         Index Cond: (p <<| '(5000,4000)'::point)
 (3 rows)
 
-SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
  count 
 -------
   5000
 (1 row)
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
                         QUERY PLAN                         
 -----------------------------------------------------------
  Aggregate
    ->  Index Only Scan using sp_quad_ind on quad_point_tbl
-         Index Cond: (p >^ '(5000,4000)'::point)
+         Index Cond: (p |>> '(5000,4000)'::point)
 (3 rows)
 
-SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
  count 
 -------
   5999
@@ -449,30 +449,30 @@ SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
 (1 row)
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
                       QUERY PLAN                       
 -------------------------------------------------------
  Aggregate
    ->  Index Only Scan using sp_kd_ind on kd_point_tbl
-         Index Cond: (p <^ '(5000,4000)'::point)
+         Index Cond: (p <<| '(5000,4000)'::point)
 (3 rows)
 
-SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
  count 
 -------
   5000
 (1 row)
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
                       QUERY PLAN                       
 -------------------------------------------------------
  Aggregate
    ->  Index Only Scan using sp_kd_ind on kd_point_tbl
-         Index Cond: (p >^ '(5000,4000)'::point)
+         Index Cond: (p |>> '(5000,4000)'::point)
 (3 rows)
 
-SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
  count 
 -------
   5999
@@ -897,34 +897,34 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
 (1 row)
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)';
-                      QUERY PLAN                       
--------------------------------------------------------
+SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
+                       QUERY PLAN                       
+--------------------------------------------------------
  Aggregate
    ->  Bitmap Heap Scan on quad_point_tbl
-         Recheck Cond: (p <^ '(5000,4000)'::point)
+         Recheck Cond: (p <<| '(5000,4000)'::point)
          ->  Bitmap Index Scan on sp_quad_ind
-               Index Cond: (p <^ '(5000,4000)'::point)
+               Index Cond: (p <<| '(5000,4000)'::point)
 (5 rows)
 
-SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
  count 
 -------
   5000
 (1 row)
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)';
-                      QUERY PLAN                       
--------------------------------------------------------
+SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
+                       QUERY PLAN                       
+--------------------------------------------------------
  Aggregate
    ->  Bitmap Heap Scan on quad_point_tbl
-         Recheck Cond: (p >^ '(5000,4000)'::point)
+         Recheck Cond: (p |>> '(5000,4000)'::point)
          ->  Bitmap Index Scan on sp_quad_ind
-               Index Cond: (p >^ '(5000,4000)'::point)
+               Index Cond: (p |>> '(5000,4000)'::point)
 (5 rows)
 
-SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
  count 
 -------
   5999
@@ -1016,34 +1016,34 @@ SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
 (1 row)
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)';
-                      QUERY PLAN                       
--------------------------------------------------------
+SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
+                       QUERY PLAN                       
+--------------------------------------------------------
  Aggregate
    ->  Bitmap Heap Scan on kd_point_tbl
-         Recheck Cond: (p <^ '(5000,4000)'::point)
+         Recheck Cond: (p <<| '(5000,4000)'::point)
          ->  Bitmap Index Scan on sp_kd_ind
-               Index Cond: (p <^ '(5000,4000)'::point)
+               Index Cond: (p <<| '(5000,4000)'::point)
 (5 rows)
 
-SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
  count 
 -------
   5000
 (1 row)
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)';
-                      QUERY PLAN                       
--------------------------------------------------------
+SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
+                       QUERY PLAN                       
+--------------------------------------------------------
  Aggregate
    ->  Bitmap Heap Scan on kd_point_tbl
-         Recheck Cond: (p >^ '(5000,4000)'::point)
+         Recheck Cond: (p |>> '(5000,4000)'::point)
          ->  Bitmap Index Scan on sp_kd_ind
-               Index Cond: (p >^ '(5000,4000)'::point)
+               Index Cond: (p |>> '(5000,4000)'::point)
 (5 rows)
 
-SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
  count 
 -------
   5999
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out
index 7ed29b4961..d7712d946b 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -1985,8 +1985,6 @@ ORDER BY 1, 2, 3;
         783 |            8 | <@
         783 |            9 | &<|
         783 |           10 | <<|
-        783 |           10 | <^
-        783 |           11 | >^
         783 |           11 | |>>
         783 |           12 | |&>
         783 |           15 | <->
@@ -2060,9 +2058,7 @@ ORDER BY 1, 2, 3;
        4000 |            8 | <@
        4000 |            9 | &<|
        4000 |           10 | <<|
-       4000 |           10 | <^
        4000 |           11 | <
-       4000 |           11 | >^
        4000 |           11 | |>>
        4000 |           12 | <=
        4000 |           12 | |&>
@@ -2081,7 +2077,7 @@ ORDER BY 1, 2, 3;
        4000 |           26 | >>
        4000 |           27 | >>=
        4000 |           28 | ^@
-(123 rows)
+(119 rows)
 
 -- Check that all opclass search operators have selectivity estimators.
 -- This is not absolutely required, but it seems a reasonable thing
diff --git a/src/test/regress/sql/create_index.sql b/src/test/regress/sql/create_index.sql
index b27643cad6..55326eb47b 100644
--- a/src/test/regress/sql/create_index.sql
+++ b/src/test/regress/sql/create_index.sql
@@ -136,9 +136,9 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 << '(0.0, 0.0)';
 
 SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)';
 
-SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)';
+SELECT count(*) FROM point_tbl p WHERE p.f1 <<| '(0.0, 0.0)';
 
-SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)';
+SELECT count(*) FROM point_tbl p WHERE p.f1 |>> '(0.0, 0.0)';
 
 SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)';
 
@@ -220,12 +220,12 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)';
 SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)';
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)';
-SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)';
+SELECT count(*) FROM point_tbl p WHERE p.f1 <<| '(0.0, 0.0)';
+SELECT count(*) FROM point_tbl p WHERE p.f1 <<| '(0.0, 0.0)';
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)';
-SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)';
+SELECT count(*) FROM point_tbl p WHERE p.f1 |>> '(0.0, 0.0)';
+SELECT count(*) FROM point_tbl p WHERE p.f1 |>> '(0.0, 0.0)';
 
 EXPLAIN (COSTS OFF)
 SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)';
diff --git a/src/test/regress/sql/create_index_spgist.sql b/src/test/regress/sql/create_index_spgist.sql
index 68632e3732..bff5f2d092 100644
--- a/src/test/regress/sql/create_index_spgist.sql
+++ b/src/test/regress/sql/create_index_spgist.sql
@@ -46,9 +46,9 @@ SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)';
 
 SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
 
-SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
 
-SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
 
 SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)';
 
@@ -126,12 +126,12 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
 SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)';
-SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)';
-SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
 
 EXPLAIN (COSTS OFF)
 SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)';
@@ -184,12 +184,12 @@ SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
 SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)';
-SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)';
-SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
 
 EXPLAIN (COSTS OFF)
 SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)';
@@ -320,12 +320,12 @@ SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
 SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)';
-SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)';
-SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
+SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
 
 EXPLAIN (COSTS OFF)
 SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)';
@@ -348,12 +348,12 @@ SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
 SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)';
-SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
 
 EXPLAIN (COSTS OFF)
-SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)';
-SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
+SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
 
 EXPLAIN (COSTS OFF)
 SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)';
-- 
2.28.0

