--- a/Makefile	2019-07-30 17:19:00.557485372 +0300
+++ b/Makefile	2019-07-30 17:19:38.869304897 +0300
@@ -12,7 +12,7 @@
 .PHONY: dist/$(EXTENSION)-$(EXTVERSION).zip
 
 # Pull out PostgreSQL version number from pg_config
-VERSION := $(shell $(PG_CONFIG) --version | sed 's/.* \([[:digit:].]\{1,\}\).*/\1/')
+VERSION := $(shell $(PG_CONFIG) --version | awk '{print $2}')
 ifeq ("$(VERSION)","")
 $(error pg_config not found)
 endif
