From 5577ca5bfb33bf7f31a03fc5b42a56de400e464e Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sat, 17 Dec 2011 18:51:00 -0500
Subject: [PATCH] Remove bogus entries in gist point_ops operator class.

These entries could never be matched to an index clause because they don't
have the index datatype on the left-hand side of the operator.  (Their
commutators are in the opclass, which is sensible, but that doesn't mean
these operators should be.)  Spotted by a test that I recently added to
opr_sanity to catch exactly this type of thinko.  AFAICT there is no code
in gistproc.c that is specifically meant to cover these cases, so nothing
to remove at that level.
---
 src/include/catalog/catversion.h         |  2 +-
 src/include/catalog/pg_amop.h            |  3 ---
 src/test/regress/expected/opr_sanity.out | 10 ++--------
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index eb343545915..fd424fa8d0c 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -53,6 +53,6 @@
  */
 
 /*							yyyymmddN */
-#define CATALOG_VERSION_NO	201112171
+#define CATALOG_VERSION_NO	201112172
 
 #endif
diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h
index cb394e03e40..63cf43322f8 100644
--- a/src/include/catalog/pg_amop.h
+++ b/src/include/catalog/pg_amop.h
@@ -605,11 +605,8 @@ DATA(insert (	1029   600 600 5 s	508 783 0 ));
 DATA(insert (	1029   600 600 10 s 509 783 0 ));
 DATA(insert (	1029   600 600 6 s	510 783 0 ));
 DATA(insert (	1029   600 600 15 o 517 783 1970 ));
-DATA(insert (	1029   603 600 27 s 433 783 0 ));
 DATA(insert (	1029   600 603 28 s 511 783 0 ));
-DATA(insert (	1029   604 600 47 s 757 783 0 ));
 DATA(insert (	1029   600 604 48 s 756 783 0 ));
-DATA(insert (	1029   718 600 67 s 759 783 0 ));
 DATA(insert (	1029   600 718 68 s 758 783 0 ));
 
 
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out
index 8e4004ed311..51ab6e5e36b 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -1041,11 +1041,8 @@ ORDER BY 1, 2, 3;
         783 |           15 | <->
         783 |           16 | @>
         783 |           18 | =
-        783 |           27 | @>
         783 |           28 | <@
-        783 |           47 | @>
         783 |           48 | <@
-        783 |           67 | @>
         783 |           68 | <@
        2742 |            1 | &&
        2742 |            1 | @@
@@ -1068,7 +1065,7 @@ ORDER BY 1, 2, 3;
        4000 |           12 | <=
        4000 |           14 | >=
        4000 |           15 | >
-(58 rows)
+(55 rows)
 
 -- Check that all opclass search operators have selectivity estimators.
 -- This is not absolutely required, but it seems a reasonable thing
@@ -1105,10 +1102,7 @@ WHERE NOT EXISTS(SELECT 1 FROM pg_opclass AS p2
                    AND binary_coercible(p2.opcintype, p1.amoplefttype));
  amopfamily | amopstrategy | amopopr 
 ------------+--------------+---------
-       1029 |           27 |     433
-       1029 |           47 |     757
-       1029 |           67 |     759
-(3 rows)
+(0 rows)
 
 -- Operators that are primary members of opclasses must be immutable (else
 -- it suggests that the index ordering isn't fixed).  Operators that are
-- 
GitLab