默认情况下,我在我的两台ubuntu 14机器上安装了postgres 10个版本,但我在这两台机器上安装了postgres 9.6。
但是其中一个pg_config给了我:
VERSION = PostgreSQL 9.6.6另一个:
VERSION = PostgreSQL 10.1它们有相同的libpq-dev包:
dpkg -l | grep libpq-dev
libpq-dev 10.1-1.pgdg14.04+1 amd64 header files for libpq5 (PostgreSQL library)所以,我想知道是否有一种方法可以改变安装的版本,使我可以使用postgres 9.6而不是postgres 10.01?或者使用pg_config文件?
Tnx,Tom
更新:在仍然显示postgres 10的实例上,这是结果(这表明它没有安装):
ii pgdg-keyring 2017.3 all keyring for apt.postgresql.org
ii postgresql-9.6 9.6.6-1.pgdg14.04+1 amd64 object-relational SQL database, version 9.6 server
ii postgresql-client-9.6 9.6.6-1.pgdg14.04+1 amd64 front-end programs for PostgreSQL 9.6
ii postgresql-client-common 189.pgdg14.04+1 all manager for multiple PostgreSQL client versions
ii postgresql-common 189.pgdg14.04+1 all PostgreSQL database-cluster manager
ii postgresql-contrib-9.6 9.6.6-1.pgdg14.04+1 amd64 additional facilities for PostgreSQL发布于 2020-12-31 22:21:32
复制:config shows 9.4 instead of 9.3
电话: Debian,Ubuntu
bash /usr/bin/pg_config被设置为查看并获得最新的/usr/lib/postgresql/*/pg_config -版本。
一个快速的解决方案,而不是优雅和软弱,可以是更新它如下。
然后更新env,例如:
export FORCE_PGCONFIG=/usr/lib/postgresql/12/pg_config/usr/bin/pg_config (更新):
PGBINROOT="/usr/lib/postgresql/"
#redhat# PGBINROOT="/usr/pgsql-"
# user edit :
if [ -n "$FORCE_PGCONFIG" ]; then
# up to you to set it properly...
LATEST_SERVER_DEV="$FORCE_PGCONFIG";
else
LATEST_SERVER_DEV=`ls -v $PGBINROOT*/bin/pg_config 2>/dev/null|tail -n1`;
fi
# end user edit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 "$@"
else
echo "You need to install postgresql-server-dev-NN for building a server-side extension or libpq-dev for building a client-side application." >&2
exit 1
fi
fihttps://stackoverflow.com/questions/48562616
复制相似问题