diff --git a/Makefile.global b/Makefile.global index fd08f4a..03b91ea 100644 --- a/Makefile.global +++ b/Makefile.global @@ -1,5 +1,17 @@ PG_CONFIG ?= pg_config +PG_MIN_VER = 14 +PG_VER = $(shell $(PG_CONFIG) --version | sed "s/^[^ ]* \([0-9]*\).*$$/\1/" 2>/dev/null) +ifeq ($(shell expr "$(PG_MIN_VER)" \<= "$(PG_VER)"), 0) +$(error Minimum version of PostgreSQL required is $(PG_MIN_VER) (but have $(PG_VER))) +endif + +# If you want to test with an unsupported PG version you can pass a different value to make +PG_MAX_VER ?= 17 +ifeq ($(shell expr "$(PG_MAX_VER)" \>= "$(PG_VER)"), 0) +$(error Maximum supported version of PostgreSQL is $(PG_MAX_VER) (but have $(PG_VER))) +endif + PGXS := $(shell $(PG_CONFIG) --pgxs) PG_LIB := $(shell $(PG_CONFIG) --pkglibdir) PG_LIBDIR := $(shell $(PG_CONFIG) --libdir)