diff --git a/Makefile.global b/Makefile.global index 140d486..135571b 100644 --- a/Makefile.global +++ b/Makefile.global @@ -6,3 +6,6 @@ RELEASE_VERSION ?= $(EXTVERSION) SED = sed PIP = pip NOSETESTS = nosetests +AWK = awk +PG_CONFIG = pg_config +PG_PARALLEL := $(shell $(PG_CONFIG) --version | ($(AWK) '{$$2*=1000; if ($$2 >= 9600) print 1; else print 0;}' 2> /dev/null || echo 0)) diff --git a/src/pg/Makefile b/src/pg/Makefile index c6fe484..32f543b 100644 --- a/src/pg/Makefile +++ b/src/pg/Makefile @@ -23,6 +23,13 @@ REPLACEMENTS = -e 's/@@VERSION@@/$(EXTVERSION)/g' $(DATA): $(SOURCES_DATA) $(SED) $(REPLACEMENTS) $(SOURCES_DATA_DIR)/*.sql > $@ +ifeq ($(PG_PARALLEL), 0) +# Remove PARALLEL in aggregates and functions + $(eval TMPFILE := $(shell mktemp /tmp/$(basename $0).XXXXXXXX)) + $(SED) -e 's/PARALLEL \= [A-Z]*,/''/g' \ + -e 's/PARALLEL [A-Z]*/''/g' $@ > $(TMPFILE) + mv $(TMPFILE) $@ +endif TEST_DIR = test REGRESS = $(sort $(notdir $(basename $(wildcard $(TEST_DIR)/sql/*test.sql))))