Tôi đang sử dụng Postgres 9.3, tuy nhiên điểm pg_config của tôi là 9.4, ngăn không cho tôi từ tiện ích mở rộng tòa nhà (pgTap).pg_config hiển thị 9.4 thay vì 9.3
$ 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
Như bạn thấy ở trên tôi có 9,3 cài đặt
$ 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,-z,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,-Bsymbolic-functions -Wl,-z,relro
-Wl,-z,now -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
Chạy ls
chống lại bất kỳ /postgresql
địa điểm từ pg_config
(ví dụ /usr/lib/postgresql
) chỉ trả lại 9.3.
Chạy which pg_config
kết quả trong: /usr/bin/pg_config
Nhìn vào /usr/bin/pg_config
(với vi), sau đây là các nội dung:
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" "[email protected]"
else
if [ -x /usr/bin/pg_config.libpq-dev ]; then
exec /usr/bin/pg_config.libpq-dev "[email protected]"
...
...
...
Bây giờ nhìn vào /usr/lib/postgresql/9.3/bin
KHÔNG tạo ra một tập tin pg_config
.
sử dụng apt-get purge postgresql-9.3
theo sau là apt-get install postgresql-9.3
KHÔNG khắc phục được sự cố.
Gần nhất tôi đã tìm thấy một câu trả lời là thế này:
https://bugs.launchpad.net/ubuntu/+source/postgresql-common/+bug/789622
tôi đã lấy cả hai bước chủ trương (nâng cấp libpq5
và libpq-dev
) để có hiệu lực.
Bất kỳ thông tin chi tiết nào về điều này có thể xảy ra và cách khắc phục (hoặc ít nhất là làm việc xung quanh?) Tôi sẽ giải quyết khả năng tự sửa lại pg_config (mặc dù giải thích và sửa lỗi thực tế sẽ tốt hơn). Có cách nào để tôi khởi tạo tệp pg_config trong thư mục /usr/lib/postgresql/9.3
không?
Và đầu ra của 'pg_config' nào? – wildplasser
được thêm vào câu hỏi,/usr/bin/pg_config của nó –