Centos 7 上编译安装PostgreSQL 9.0报错:FATAL: wrong number of index expressions
  LXuaLTTTbRCJ 2023年11月02日 57 0


报错信息:

-bash-4.2$ /usr/local/pg9.0/bin/initdb -D /usr/local/pg9.0/data/
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to "english".

fixing permissions on existing directory /usr/local/pg9.0/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /usr/local/pg9.0/data/base/1 ... ok
initializing pg_authid ... FATAL: wrong number of index expressions
STATEMENT: REVOKE ALL on pg_authid FROM public;

child process exited with exit code 1
initdb: removing contents of data directory "/usr/local/pg9.0/data"

问题原因:

​gcc​​​版本过高。高版本的​​gcc​​采用了更激进的循环上界分析推导算法。但这会导致一些旧的程序运行出错。

解决方案:

  • 推荐的方法:升级PostgreSQL到更新的版本。
  • 如果无法更换PG数据库版本和操作系统版本,则可以采取如下临时解决方案:
    1.在数据库编译安装进行configure操作时,添加参数​​"-Wno-aggressive-loop-optimizations"​​或​​"-fno-aggressive-loop-optimizations"​​。
    如:
./configure --prefix=/usr/local/pg9.0 CFLAGS="-Wno-aggressive-loop-optimizations"
make clean
make
make install

我的环境 gcc 4.8.5


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
LXuaLTTTbRCJ