ec2服务器postgres错误"找不到版本`GLIBC_2.14'"

Lau*_*ren 12 postgresql glibc libc amazon-ec2 psql

尝试\i create_db.sqlpsql时会抛出错误:

psql:create_db.sql:123: ERROR:  could not load library 
"/usr/lib64/pgsql/plpgsql.so": /lib64/libc.so.6: version 
`GLIBC_2.14' not found (required by /usr/lib64/pgsql/plpgsql.so)
Run Code Online (Sandbox Code Playgroud)

create_db.sql的第123行是文件的最后一行,位于函数定义的末尾:

$$ language plpgsql;
Run Code Online (Sandbox Code Playgroud)

东西的版本:

$ psql --version
psql (PostgreSQL) 9.2.7

$ /lib64/libc.so.6 --version
GNU C Library (GNU libc) stable release version 2.17, by Roland McGrath et al.
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.8.2 20131212 (Red Hat 4.8.2-7).
Compiled on a Linux 3.2.5 system on 2014-06-09.
Available extensions:
    The C stubs add-on version 2.1.2.
    crypt add-on version 2.1 by Michael Glad and others
    GNU Libidn by Simon Josefsson
    Native POSIX Threads Library by Ulrich Drepper et al
    BIND-8.2.3-T5B
    RT using linux kernel aio
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
Run Code Online (Sandbox Code Playgroud)

我是否需要glibc确切版本2.14或2.17也应该工作?

Cra*_*ger 7

你的PostgreSQL安装,或者你的操作系统安装,至少有点破碎.

猜测,您必须强制安装一些随机发现的RPM,而不是配置存储库并使用yum install安装PostgreSQL.

您不需要完全匹配的glibc版本.它只需通过暴露一个合适的符号来声明它与所需的版本兼容GLIBC_.

例如在我的Fedora 20上,使用glibc 2.18,运行为glibc 2.14编译的程序没有问题,因为:

$ /lib64/libc.so.6 --version
GNU C Library (GNU libc) stable release version 2.18, by Roland McGrath et al.

$ nm /lib64/libc.so.6| grep GLIBC_2.14
0000000000000000 A GLIBC_2.14
Run Code Online (Sandbox Code Playgroud)

我的glibc声明它与2.14兼容.