Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add postgres version check in makefile #605

Merged
merged 4 commits into from
Feb 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Makefile.global
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
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

PG_MAX_VER = 17
ifeq ($(shell expr "$(PG_MAX_VER)" \>= "$(PG_VER)"), 0)
$(error maximum version of PostgreSQL required 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)
Expand Down