aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/lsyscache.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-07-06 14:53:16 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-07-06 14:53:16 -0400
commit14f67192c25a130a354f3e3e6db3dfd49d2f5c86 (patch)
treeeca994c83e70ffa64b085f6ca316e0056ffb23aa /src/include/utils/lsyscache.h
parentc7f23494c1103f87bcf1ef7cbfcd626e73edb337 (diff)
downloadpostgresql-14f67192c25a130a354f3e3e6db3dfd49d2f5c86.tar.gz
postgresql-14f67192c25a130a354f3e3e6db3dfd49d2f5c86.zip
Remove assumptions that not-equals operators cannot be in any opclass.
get_op_btree_interpretation assumed this in order to save some duplication of code, but it's not true in general anymore because we added <> support to btree_gist. (We still assume it for btree opclasses, though.) Also, essentially the same logic was baked into predtest.c. Get rid of that duplication by generalizing get_op_btree_interpretation so that it can be used by predtest.c. Per bug report from Denis de Bernardy and investigation by Jeff Davis, though I didn't use Jeff's patch exactly as-is. Back-patch to 9.1; we do not support this usage before that.
Diffstat (limited to 'src/include/utils/lsyscache.h')
-rw-r--r--src/include/utils/lsyscache.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/include/utils/lsyscache.h b/src/include/utils/lsyscache.h
index 0a419dcf65b..f4490adc318 100644
--- a/src/include/utils/lsyscache.h
+++ b/src/include/utils/lsyscache.h
@@ -17,6 +17,15 @@
#include "access/htup.h"
#include "nodes/pg_list.h"
+/* Result list element for get_op_btree_interpretation */
+typedef struct OpBtreeInterpretation
+{
+ Oid opfamily_id; /* btree opfamily containing operator */
+ int strategy; /* its strategy number */
+ Oid oplefttype; /* declared left input datatype */
+ Oid oprighttype; /* declared right input datatype */
+} OpBtreeInterpretation;
+
/* I/O function selector for get_type_io_data */
typedef enum IOFuncSelector
{
@@ -50,8 +59,7 @@ extern bool get_compatible_hash_operators(Oid opno,
Oid *lhs_opno, Oid *rhs_opno);
extern bool get_op_hash_functions(Oid opno,
RegProcedure *lhs_procno, RegProcedure *rhs_procno);
-extern void get_op_btree_interpretation(Oid opno,
- List **opfamilies, List **opstrats);
+extern List *get_op_btree_interpretation(Oid opno);
extern bool equality_ops_are_compatible(Oid opno1, Oid opno2);
extern Oid get_opfamily_proc(Oid opfamily, Oid lefttype, Oid righttype,
int16 procnum);