Add a Makefile check to avoid building against PostgreSQL 9.4+

Better to error out early during make, rather than failing with an
obscure error during CREATE EXTENSION.
This commit is contained in:
Josh Kupershmidt 2015-01-11 19:06:20 -05:00
parent 080ebd3ed6
commit 0cb40b6204

View File

@ -24,11 +24,14 @@ INTVERSION := $(shell echo $$(($$(echo $(VERSION) | sed 's/\([[:digit:]]\{1,\}\)
EXTVERSION = $(shell grep '"version":' META.json | head -1 \
| sed -e 's/[ ]*"version":[ ]*"\(.*\)",/\1/')
# We support PostgreSQL 8.3 and later.
# We support PostgreSQL 8.3 through 9.3. We DO NOT yet support 9.4+.
ifeq ($(shell echo $$(($(INTVERSION) < 803))),1)
$(error $(EXTENSION) requires PostgreSQL 8.3 or later. This is $(VERSION))
endif
ifeq ($(shell echo $$(($(INTVERSION) >= 904))),1)
$(error $(EXTENSION) does not yet support PostgreSQL 9.4 or later. This is $(VERSION))
endif
SUBDIRS = bin lib regress