我正在使用Postgres 9.3,但是我的pg_config指向9.4,阻止了我
来自构建扩展(pgTap).
原文链接:https://www.f2er.com/postgresql/191857.html来自构建扩展(pgTap).
$sudo aptitude search postgresql | grep ^i i postgresql-9.3 - object-relational sql database,version 9. i postgresql-client-9.3 - front-end programs for Postgresql 9.3 i A postgresql-client-common - manager for multiple Postgresql client ver i A postgresql-common - Postgresql database-cluster manager i postgresql-contrib-9.3 - additional facilities for Postgresql
如您所见,我安装了9.3
$pg_config BINDIR = /usr/lib/postgresql/9.4/bin DOCDIR = /usr/share/doc/postgresql-doc-9.4 HTMLDIR = /usr/share/doc/postgresql-doc-9.4 INCLUDEDIR = /usr/include/postgresql PKGINCLUDEDIR = /usr/include/postgresql INCLUDEDIR-SERVER = /usr/include/postgresql/9.4/server LIBDIR = /usr/lib/x86_64-linux-gnu PKGLIBDIR = /usr/lib/postgresql/9.4/lib LOCALEDIR = /usr/share/locale MANDIR = /usr/share/postgresql/9.4/man SHAREDIR = /usr/share/postgresql/9.4 SYSCONFDIR = /etc/postgresql-common PGXS = /usr/lib/postgresql/9.4/lib/pgxs/src/makefiles/pgxs.mk CONFIGURE = '--with-tcl' '--with-perl' '--with-python' '--with-pam' '--with-openssl' '--with-libxml' '--with-libxslt' '--with-tclconfig=/usr/lib/tcl8.5' '--with-includes=/usr/include/tcl8.5' 'PYTHON=/usr/bin/python' '--mandir=/usr/share/postgresql/9.4/man' '--docdir=/usr/share/doc/postgresql-doc-9.4' '--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/' '--datadir=/usr/share/postgresql/9.4' '--bindir=/usr/lib/postgresql/9.4/bin' '--libdir=/usr/lib/x86_64-linux-gnu/' '--libexecdir=/usr/lib/postgresql/' '--includedir=/usr/include/postgresql/' '--enable-nls' '--enable-integer-datetimes' '--enable-thread-safety' '--enable-debug' '--disable-rpath' '--with-uuid=e2fs' '--with-gnu-ld' '--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -DLINUX_OOM_score_ADJ=0 -fno-omit-frame-pointer' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,now -Wl,--as-needed -L/usr/lib/mit-krb5 -L/usr/lib/x86_64-linux-gnu/mit-krb5' '--with-krb5' '--with-gssapi' '--with-ldap' 'CPPFLAGS=-D_FORTIFY_SOURCE=2' CC = gcc CPPFLAGS = -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.5 CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -DLINUX_OOM_score_ADJ=0 -fno-omit-frame-pointer CFLAGS_SL = -fpic LDFLAGS = -L../../../src/common -Wl,--as-needed -L/usr/lib/mit-krb5 -L/usr/lib/x86_64-linux-gnu/mit-krb5 -L/usr/lib/x86_64-linux-gnu -Wl,--as-needed LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm VERSION = Postgresql 9.4.1
从pg_config(例如/usr/lib / postgresql)对任何/ postgresql位置运行ls只返回9.3.
运行哪个pg_config导致:
在/usr/bin中/ pg_config
查看/usr/bin/pg_config(使用vi),以下是内容:
PGBINROOT="/usr/lib/postgresql/" LATEST_SERVER_DEV=`ls $PGBINROOT*/bin/pg_config 2>/dev/null|tail -n1` if [ -n "$LATEST_SERVER_DEV" ]; then exec "$LATEST_SERVER_DEV" "$@" else if [ -x /usr/bin/pg_config.libpq-dev ]; then exec /usr/bin/pg_config.libpq-dev "$@" ... ... ...
现在查看/usr/lib/postgresql/9.3/bin不会产生pg_config文件.
使用apt-get purge postgresql-9.3后跟apt-get install postgresql-9.3不能解决问题.
我找到答案的最接近的是:
https://bugs.launchpad.net/ubuntu/+source/postgresql-common/+bug/789622
我已采取主张(升级libpq5和libpq-dev)这两个步骤无效.
有关这可能发生的任何见解,以及如何解决它(或至少解决它?)我会满足于手动重新命名pg_config的能力(虽然实际的解释和修复会更好).我是否只有一种方法可以在/usr/lib/postgresql/9.3目录中实例化pg_config文件?