#include <limits.h>
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "utils/builtins.h"
#include "utils/bytea.h"
#include "utils/cash.h"
#include <math.h>
#include "access/gist.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "postgres.h"
#include "access/gin.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "catalog/pg_type.h"
#include "hstore.h"
#include "postgres.h"
#include "access/gist.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "catalog/pg_type.h"
#include "utils/pg_crc.h"
#include "postgres.h"
#include "access/gin.h"
-#include "access/gist.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "_int.h"
#include <limits.h>
#include "access/gist.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "_int.h"
#include "postgres.h"
#include "access/gist.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "_int.h"
#include "postgres.h"
#include "access/gist.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "crc32.h"
#include "ltree.h"
#include "postgres.h"
#include "access/gist.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "crc32.h"
#include "ltree.h"
#include "trgm.h"
#include "access/gin.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
+#include "fmgr.h"
PG_FUNCTION_INFO_V1(gin_extract_trgm);
#include "trgm.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
+#include "fmgr.h"
typedef struct
#include <float.h>
#include "access/gist.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
+#include "fmgr.h"
#include "segdata.h"
#include "access/genam.h"
#include "access/brin_internal.h"
#include "access/brin_tuple.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "catalog/pg_type.h"
#include "catalog/pg_amop.h"
#include "utils/datum.h"
#include "postgres.h"
#include "access/gin.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "postgres.h"
#include "access/gist.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "utils/geo_decls.h"
#include "postgres.h"
-#include "access/gist.h" /* for RTree strategy numbers */
#include "access/spgist.h"
+#include "access/stratnum.h"
#include "catalog/pg_type.h"
#include "utils/builtins.h"
#include "utils/geo_decls.h"
#include "postgres.h"
-#include "access/gist.h" /* for RTree strategy numbers */
#include "access/spgist.h"
+#include "access/stratnum.h"
#include "catalog/pg_type.h"
#include "utils/builtins.h"
#include "utils/geo_decls.h"
#include "access/attnum.h"
#include "access/htup.h"
#include "access/itup.h"
-#include "access/skey.h"
#include "access/tupdesc.h"
#include "access/xact.h"
#include "bootstrap/bootstrap.h"
#include "access/attnum.h"
#include "access/htup.h"
#include "access/itup.h"
-#include "access/skey.h"
#include "access/tupdesc.h"
#include "bootstrap/bootstrap.h"
#include "catalog/pg_am.h"
*/
#include "postgres.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "catalog/pg_type.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include <math.h>
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "access/sysattr.h"
#include "catalog/pg_am.h"
#include "catalog/pg_collation.h"
*/
#include "postgres.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "nodes/plannodes.h"
#include <limits.h>
#include <math.h>
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "access/sysattr.h"
#include "catalog/pg_class.h"
#include "catalog/pg_operator.h"
* Define "operator implication tables" for btree operators ("strategies"),
* and similar tables for refutation.
*
- * The strategy numbers defined by btree indexes (see access/skey.h) are:
+ * The strategy numbers defined by btree indexes (see access/stratnum.h) are:
* 1 < 2 <= 3 = 4 >= 5 >
* and in addition we use 6 to represent <>. <> is not a btree-indexable
* operator, but we assume here that if an equality operator of a btree
#include "access/gin.h"
#include "access/hash.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_type.h"
#include "utils/builtins.h"
#include <sys/socket.h>
#include "access/gist.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "utils/inet.h"
/*
* Operator strategy numbers used in the GiST inet_ops opclass
*/
-#define INETSTRAT_OVERLAPS 3
-#define INETSTRAT_EQ 18
-#define INETSTRAT_NE 19
-#define INETSTRAT_LT 20
-#define INETSTRAT_LE 21
-#define INETSTRAT_GT 22
-#define INETSTRAT_GE 23
-#define INETSTRAT_SUB 24
-#define INETSTRAT_SUBEQ 25
-#define INETSTRAT_SUP 26
-#define INETSTRAT_SUPEQ 27
+#define INETSTRAT_OVERLAPS RTOverlapStrategyNumber
+#define INETSTRAT_EQ RTEqualStrategyNumber
+#define INETSTRAT_NE RTNotEqualStrategyNumber
+#define INETSTRAT_LT RTLessStrategyNumber
+#define INETSTRAT_LE RTLessEqualStrategyNumber
+#define INETSTRAT_GT RTGreaterStrategyNumber
+#define INETSTRAT_GE RTGreaterEqualStrategyNumber
+#define INETSTRAT_SUB RTSubStrategyNumber
+#define INETSTRAT_SUBEQ RTSubOrEqualStrategyNumber
+#define INETSTRAT_SUP RTSuperStrategyNumber
+#define INETSTRAT_SUPEQ RTSuperOrEqualStrategyNumber
/*
#include "postgres.h"
#include "access/gist.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "utils/builtins.h"
#include "utils/datum.h"
#include "utils/rangetypes.h"
#include "postgres.h"
#include "access/spgist.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "catalog/pg_type.h"
#include "utils/builtins.h"
#include "utils/datum.h"
#include "postgres.h"
#include "access/gin.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "miscadmin.h"
#include "tsearch/ts_type.h"
#include "tsearch/ts_utils.h"
#include "postgres.h"
-#include "access/skey.h"
+#include "access/stratnum.h"
#include "access/gist.h"
#include "tsearch/ts_utils.h"
#define GIST_FETCH_PROC 9
#define GISTNProcs 9
-/*
- * strategy numbers for GiST opclasses that want to implement the old
- * RTREE behavior.
- */
-#define RTLeftStrategyNumber 1
-#define RTOverLeftStrategyNumber 2
-#define RTOverlapStrategyNumber 3
-#define RTOverRightStrategyNumber 4
-#define RTRightStrategyNumber 5
-#define RTSameStrategyNumber 6
-#define RTContainsStrategyNumber 7 /* for @> */
-#define RTContainedByStrategyNumber 8 /* for <@ */
-#define RTOverBelowStrategyNumber 9
-#define RTBelowStrategyNumber 10
-#define RTAboveStrategyNumber 11
-#define RTOverAboveStrategyNumber 12
-#define RTOldContainsStrategyNumber 13 /* for old spelling of @> */
-#define RTOldContainedByStrategyNumber 14 /* for old spelling of <@ */
-#define RTKNNSearchStrategyNumber 15
-
/*
* Page opaque data in a GiST index page.
*/
/*
- * Operator strategy numbers for B-tree have been moved to access/skey.h,
+ * Operator strategy numbers for B-tree have been moved to access/stratnum.h,
* because many places need to use them in ScanKeyInit() calls.
*
* The strategy numbers are chosen so that we can commute them by
#define SKEY_H
#include "access/attnum.h"
+#include "access/stratnum.h"
#include "fmgr.h"
-/*
- * Strategy numbers identify the semantics that particular operators have
- * with respect to particular operator classes. In some cases a strategy
- * subtype (an OID) is used as further information.
- */
-typedef uint16 StrategyNumber;
-
-#define InvalidStrategy ((StrategyNumber) 0)
-
-/*
- * We define the strategy numbers for B-tree indexes here, to avoid having
- * to import access/nbtree.h into a lot of places that shouldn't need it.
- */
-#define BTLessStrategyNumber 1
-#define BTLessEqualStrategyNumber 2
-#define BTEqualStrategyNumber 3
-#define BTGreaterEqualStrategyNumber 4
-#define BTGreaterStrategyNumber 5
-
-#define BTMaxStrategyNumber 5
-
-
/*
* A ScanKey represents the application of a comparison operator between
* a table or index column and a constant. When it's part of an array of
--- /dev/null
+/*-------------------------------------------------------------------------
+ *
+ * stratnum.h
+ * POSTGRES strategy number definitions.
+ *
+ *
+ * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/access/stratnum.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef STRATNUM_H
+#define STRATNUM_H
+
+/*
+ * Strategy numbers identify the semantics that particular operators have
+ * with respect to particular operator classes. In some cases a strategy
+ * subtype (an OID) is used as further information.
+ */
+typedef uint16 StrategyNumber;
+
+#define InvalidStrategy ((StrategyNumber) 0)
+
+/*
+ * Strategy numbers for B-tree indexes.
+ */
+#define BTLessStrategyNumber 1
+#define BTLessEqualStrategyNumber 2
+#define BTEqualStrategyNumber 3
+#define BTGreaterEqualStrategyNumber 4
+#define BTGreaterStrategyNumber 5
+
+#define BTMaxStrategyNumber 5
+
+
+/*
+ * Strategy numbers common to (some) GiST, SP-GiST and BRIN opclasses.
+ *
+ * The first few of these come from the R-Tree indexing method (hence the
+ * names); the others have been added over time as they have been needed.
+ */
+#define RTLeftStrategyNumber 1 /* for << */
+#define RTOverLeftStrategyNumber 2 /* for &< */
+#define RTOverlapStrategyNumber 3 /* for && */
+#define RTOverRightStrategyNumber 4 /* for &> */
+#define RTRightStrategyNumber 5 /* for >> */
+#define RTSameStrategyNumber 6 /* for ~= */
+#define RTContainsStrategyNumber 7 /* for @> */
+#define RTContainedByStrategyNumber 8 /* for <@ */
+#define RTOverBelowStrategyNumber 9 /* for &<| */
+#define RTBelowStrategyNumber 10 /* for <<| */
+#define RTAboveStrategyNumber 11 /* for |>> */
+#define RTOverAboveStrategyNumber 12 /* for |&> */
+#define RTOldContainsStrategyNumber 13 /* for old spelling of @> */
+#define RTOldContainedByStrategyNumber 14 /* for old spelling of <@ */
+#define RTKNNSearchStrategyNumber 15 /* for <-> (distance) */
+#define RTContainsElemStrategyNumber 16 /* for range types @> elem */
+#define RTAdjacentStrategyNumber 17 /* for -|- */
+#define RTEqualStrategyNumber 18 /* for = */
+#define RTNotEqualStrategyNumber 19 /* for != */
+#define RTLessStrategyNumber 20 /* for < */
+#define RTLessEqualStrategyNumber 21 /* for <= */
+#define RTGreaterStrategyNumber 22 /* for > */
+#define RTGreaterEqualStrategyNumber 23 /* for >= */
+#define RTSubStrategyNumber 24 /* for inet >> */
+#define RTSubOrEqualStrategyNumber 25 /* for inet <<= */
+#define RTSuperStrategyNumber 26 /* for inet << */
+#define RTSuperOrEqualStrategyNumber 27 /* for inet >>= */
+
+#define RTMaxStrategyNumber 27
+
+
+#endif /* STRATNUM_H */
/* Operator strategy numbers used in the GiST and SP-GiST range opclasses */
/* Numbers are chosen to match up operator names with existing usages */
-#define RANGESTRAT_BEFORE 1
-#define RANGESTRAT_OVERLEFT 2
-#define RANGESTRAT_OVERLAPS 3
-#define RANGESTRAT_OVERRIGHT 4
-#define RANGESTRAT_AFTER 5
-#define RANGESTRAT_ADJACENT 6
-#define RANGESTRAT_CONTAINS 7
-#define RANGESTRAT_CONTAINED_BY 8
-#define RANGESTRAT_CONTAINS_ELEM 16
-#define RANGESTRAT_EQ 18
+#define RANGESTRAT_BEFORE RTLeftStrategyNumber
+#define RANGESTRAT_OVERLEFT RTOverLeftStrategyNumber
+#define RANGESTRAT_OVERLAPS RTOverlapStrategyNumber
+#define RANGESTRAT_OVERRIGHT RTOverRightStrategyNumber
+#define RANGESTRAT_AFTER RTRightStrategyNumber
+#define RANGESTRAT_ADJACENT RTSameStrategyNumber
+#define RANGESTRAT_CONTAINS RTContainsStrategyNumber
+#define RANGESTRAT_CONTAINED_BY RTContainedByStrategyNumber
+#define RANGESTRAT_CONTAINS_ELEM RTContainsElemStrategyNumber
+#define RANGESTRAT_EQ RTEqualStrategyNumber
/*
* prototypes for functions defined in rangetypes.c