diff --git a/Makefile b/Makefile index 61b4aeb87..8fac03cc4 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ endif MVER = $(firstword $(VER_WORDS)) +# version >= 12? ifeq ($(lastword $(sort 12 $(MVER))),$(MVER)) USE_TABLEAM = yes USE_FDW = yes @@ -32,7 +33,7 @@ DATA = cstore_fdw--1.7.sql cstore_fdw--1.6--1.7.sql cstore_fdw--1.5--1.6.sql cs cstore_fdw--1.3--1.4.sql cstore_fdw--1.2--1.3.sql cstore_fdw--1.1--1.2.sql \ cstore_fdw--1.0--1.1.sql cstore_fdw--1.7--1.8.sql -REGRESS = extension_create +REGRESS = extension_create EXTRA_CLEAN = cstore.pb-c.h cstore.pb-c.c data/*.cstore data/*.cstore.footer \ sql/block_filtering.sql sql/create.sql sql/data_types.sql sql/load.sql \ sql/copyto.sql expected/block_filtering.out expected/create.out \ @@ -74,10 +75,7 @@ PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) -installcheck: remove_cstore_files - -remove_cstore_files: - rm -f data/*.cstore data/*.cstore.footer +installcheck: reindent: citus_indent . diff --git a/mod.c b/mod.c index cd4072e25..3e041dd7a 100644 --- a/mod.c +++ b/mod.c @@ -16,28 +16,38 @@ #include "fmgr.h" #include "mod.h" -#if PG_VERSION_NUM >= 120000 + +#ifdef USE_TABLEAM #include "cstore_tableam.h" #endif + +#ifdef USE_FDW #include "cstore_fdw.h" +#endif PG_MODULE_MAGIC; void _PG_init(void) { -#if PG_VERSION_NUM >= 120000 +#ifdef USE_TABLEAM cstore_tableam_init(); #endif + +#ifdef USE_FDW cstore_fdw_init(); +#endif } void _PG_fini(void) { -#if PG_VERSION_NUM >= 120000 +#if USE_TABLEAM cstore_tableam_finish(); #endif + +#ifdef USE_FDW cstore_fdw_finish(); +#endif }