我在CentOS 5 x86_64 VPS中安装了以下命令:
我指定了要安装哪个Postgresql版本,所以选择9.1,因为我希望将开发环境与生产环境等同起来:
wget http://yum.pgrpms.org/9.1/redhat/rhel-5-x86_64/pgdg-centos91-9.1-4.noarch.rpm然后
yum install postgresql91-server最后
service postgresql-9.1 initdb
chkconfig postgresql-9.1 on
service postgresql-9.1 start在完成所有这些并创建数据库之后,我运行psql myfirstdb并得到以下警告:
Welcome to psql 8.1.23 (server 9.1.11), the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
WARNING: You are connected to a server with major version 9.1,
but your psql client is major version 8.1. Some backslash commands,
such as \d, might not work properly.也就是说,我有9.1服务器,使用psql客户端8.1,一些命令(如\d )无法工作。
我该怎么修理它们?
发布于 2014-01-01 03:54:48
您可能有多个版本的PostgreSQL,并且使用了错误的psql版本。试一试
sudo find / -name psql然后检查文件的版本,并通过设置路径使用正确的文件。
/usr/pgsql-9.3/bin/psql -V
psql (PostgreSQL) 9.3.2你也可以试试
yum list installed | grep postgres查看系统中存在哪些版本的PostgreSQL。
发布于 2013-12-31 14:01:29
psql客户端位于与psql服务器不同的包中。它通常被称为postgresql。
发布于 2014-12-01 02:51:24
客户端包postgresql91是服务器包postgresql91-server所依赖的。所以您已经安装了客户端,但这不是默认的。
RH包使用从Debian借来的替代机制来控制哪个程序的运行。您可以选择要使用的版本:
sudo update-alternatives --config pgsql-psql..。虽然我不确定你正在使用的旧版本是否如此。
或者,您可以将PATH设置为放在较新的二进制文件之前。附加到.bash_profile:
export PATH=/usr/pgsql-9.1/bin:$PATH然后关闭并重新打开航站楼。
https://unix.stackexchange.com/questions/107268
复制相似问题