diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2015-05-15 17:03:16 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2015-05-15 17:03:16 -0300 |
commit | 26df7066cc229887d4defdf1d105c0a22b8a88fb (patch) | |
tree | 5b9cd2cefa7c52d703f9d51a48426f9820118f03 /src/backend | |
parent | 1e98fa0bf8de9d25d97fb346755a9c9c17bba549 (diff) | |
download | postgresql-26df7066cc229887d4defdf1d105c0a22b8a88fb.tar.gz postgresql-26df7066cc229887d4defdf1d105c0a22b8a88fb.zip |
Move strategy numbers to include/access/stratnum.h
For upcoming BRIN opclasses, it's convenient to have strategy numbers
defined in a single place. Since there's nothing appropriate, create
it. The StrategyNumber typedef now lives there, as well as existing
strategy numbers for B-trees (from skey.h) and R-tree-and-friends (from
gist.h). skey.h is forced to include stratnum.h because of the
StrategyNumber typedef, but gist.h is not; extensions that currently
rely on gist.h for rtree strategy numbers might need to add a new
A few .c files can stop including skey.h and/or gist.h, which is a nice
side benefit.
Per discussion:
https://www.postgresql.org/message-id/20150514232132.GZ2523@alvh.no-ip.org
Authored by Emre Hasegeli and Álvaro.
(It's not clear to me why bootscanner.l has any #include lines at all.)
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/access/brin/brin_minmax.c | 2 | ||||
-rw-r--r-- | src/backend/access/gin/ginarrayproc.c | 2 | ||||
-rw-r--r-- | src/backend/access/gist/gistproc.c | 2 | ||||
-rw-r--r-- | src/backend/access/spgist/spgkdtreeproc.c | 2 | ||||
-rw-r--r-- | src/backend/access/spgist/spgquadtreeproc.c | 2 | ||||
-rw-r--r-- | src/backend/bootstrap/bootparse.y | 1 | ||||
-rw-r--r-- | src/backend/bootstrap/bootscanner.l | 1 | ||||
-rw-r--r-- | src/backend/optimizer/path/equivclass.c | 2 | ||||
-rw-r--r-- | src/backend/optimizer/path/indxpath.c | 2 | ||||
-rw-r--r-- | src/backend/optimizer/path/pathkeys.c | 2 | ||||
-rw-r--r-- | src/backend/optimizer/plan/createplan.c | 2 | ||||
-rw-r--r-- | src/backend/optimizer/util/predtest.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/jsonb_gin.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/network_gist.c | 24 | ||||
-rw-r--r-- | src/backend/utils/adt/rangetypes_gist.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/rangetypes_spgist.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/tsginidx.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/tsquery_gist.c | 2 |
18 files changed, 27 insertions, 29 deletions
diff --git a/src/backend/access/brin/brin_minmax.c b/src/backend/access/brin/brin_minmax.c index d64c4f08644..1175649a6d6 100644 --- a/src/backend/access/brin/brin_minmax.c +++ b/src/backend/access/brin/brin_minmax.c @@ -13,7 +13,7 @@ #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" diff --git a/src/backend/access/gin/ginarrayproc.c b/src/backend/access/gin/ginarrayproc.c index 9c26e778662..9220b5fccc5 100644 --- a/src/backend/access/gin/ginarrayproc.c +++ b/src/backend/access/gin/ginarrayproc.c @@ -14,7 +14,7 @@ #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" diff --git a/src/backend/access/gist/gistproc.c b/src/backend/access/gist/gistproc.c index 9667e397ce4..4cea3f1be18 100644 --- a/src/backend/access/gist/gistproc.c +++ b/src/backend/access/gist/gistproc.c @@ -18,7 +18,7 @@ #include "postgres.h" #include "access/gist.h" -#include "access/skey.h" +#include "access/stratnum.h" #include "utils/geo_decls.h" diff --git a/src/backend/access/spgist/spgkdtreeproc.c b/src/backend/access/spgist/spgkdtreeproc.c index 6ea0954efb3..88c0df25894 100644 --- a/src/backend/access/spgist/spgkdtreeproc.c +++ b/src/backend/access/spgist/spgkdtreeproc.c @@ -15,8 +15,8 @@ #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" diff --git a/src/backend/access/spgist/spgquadtreeproc.c b/src/backend/access/spgist/spgquadtreeproc.c index e4b8888de8a..a5f93614df3 100644 --- a/src/backend/access/spgist/spgquadtreeproc.c +++ b/src/backend/access/spgist/spgquadtreeproc.c @@ -15,8 +15,8 @@ #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" diff --git a/src/backend/bootstrap/bootparse.y b/src/backend/bootstrap/bootparse.y index 6e563b67e61..d8d1b06ff0a 100644 --- a/src/backend/bootstrap/bootparse.y +++ b/src/backend/bootstrap/bootparse.y @@ -21,7 +21,6 @@ #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" diff --git a/src/backend/bootstrap/bootscanner.l b/src/backend/bootstrap/bootscanner.l index 72714f474bf..e60d377ccc3 100644 --- a/src/backend/bootstrap/bootscanner.l +++ b/src/backend/bootstrap/bootscanner.l @@ -18,7 +18,6 @@ #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" diff --git a/src/backend/optimizer/path/equivclass.c b/src/backend/optimizer/path/equivclass.c index eb65c970d70..80021d57bdc 100644 --- a/src/backend/optimizer/path/equivclass.c +++ b/src/backend/optimizer/path/equivclass.c @@ -16,7 +16,7 @@ */ #include "postgres.h" -#include "access/skey.h" +#include "access/stratnum.h" #include "catalog/pg_type.h" #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index fdd6baba6c6..26e6e1b6512 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -17,7 +17,7 @@ #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" diff --git a/src/backend/optimizer/path/pathkeys.c b/src/backend/optimizer/path/pathkeys.c index 42183dfecbc..8b25222b93a 100644 --- a/src/backend/optimizer/path/pathkeys.c +++ b/src/backend/optimizer/path/pathkeys.c @@ -17,7 +17,7 @@ */ #include "postgres.h" -#include "access/skey.h" +#include "access/stratnum.h" #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" #include "nodes/plannodes.h" diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index c6095167e80..0775a676d05 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -19,7 +19,7 @@ #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" diff --git a/src/backend/optimizer/util/predtest.c b/src/backend/optimizer/util/predtest.c index cd34766c9a7..d9e49d127e1 100644 --- a/src/backend/optimizer/util/predtest.c +++ b/src/backend/optimizer/util/predtest.c @@ -1248,7 +1248,7 @@ list_member_strip(List *list, Expr *datum) * 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 diff --git a/src/backend/utils/adt/jsonb_gin.c b/src/backend/utils/adt/jsonb_gin.c index bc521ed8319..2591c81f3d6 100644 --- a/src/backend/utils/adt/jsonb_gin.c +++ b/src/backend/utils/adt/jsonb_gin.c @@ -15,7 +15,7 @@ #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" diff --git a/src/backend/utils/adt/network_gist.c b/src/backend/utils/adt/network_gist.c index cd2b8b19a77..2e3ee1e8ba7 100644 --- a/src/backend/utils/adt/network_gist.c +++ b/src/backend/utils/adt/network_gist.c @@ -48,23 +48,23 @@ #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 /* diff --git a/src/backend/utils/adt/rangetypes_gist.c b/src/backend/utils/adt/rangetypes_gist.c index ef841219d00..ddeb18b72f9 100644 --- a/src/backend/utils/adt/rangetypes_gist.c +++ b/src/backend/utils/adt/rangetypes_gist.c @@ -15,7 +15,7 @@ #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" diff --git a/src/backend/utils/adt/rangetypes_spgist.c b/src/backend/utils/adt/rangetypes_spgist.c index d7b208118ff..9281529d7a1 100644 --- a/src/backend/utils/adt/rangetypes_spgist.c +++ b/src/backend/utils/adt/rangetypes_spgist.c @@ -37,7 +37,7 @@ #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" diff --git a/src/backend/utils/adt/tsginidx.c b/src/backend/utils/adt/tsginidx.c index 828175b7a12..da90ca84f87 100644 --- a/src/backend/utils/adt/tsginidx.c +++ b/src/backend/utils/adt/tsginidx.c @@ -14,7 +14,7 @@ #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" diff --git a/src/backend/utils/adt/tsquery_gist.c b/src/backend/utils/adt/tsquery_gist.c index d610bbc7917..232715c5740 100644 --- a/src/backend/utils/adt/tsquery_gist.c +++ b/src/backend/utils/adt/tsquery_gist.c @@ -14,7 +14,7 @@ #include "postgres.h" -#include "access/skey.h" +#include "access/stratnum.h" #include "access/gist.h" #include "tsearch/ts_utils.h" |