/contrib/contrib-global.mk: No such file or directory

postgresql 安裝插件時提示找不到~global.mk

當postgresql 安裝插件時,遇到了/contrib/contrib-global.mk:

打開MakeFile

ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/pg_freespacemap
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif

看到第一行有個判斷,判斷是否定義了USE_PGXS參數
PGXS參數可以見pg官網。

所以,可以在make 的時候加上USE_PGXS就可以了

make USE_PGXS=1
make USE_PGXS=1 install

問題解決

問題分支
有可能會出現這個問題:

make: pg_config: Command not found

出現這個原因是你沒有把相應的bin目錄加到環境變量中

linux

export PATH=$PATH:$PGHOME/bin

PGHOME爲你的數據庫安裝目錄
bin 爲你的pg_config所在目錄

問題再一次解決

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章