尝试\i create_db.sql
psql时会抛出错误:
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)
create_db.sql的第123行是文件的最后一行,位于函数定义的末尾:
$$ language plpgsql;
东西的版本:
$ 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>.
我是否需要glibc确切版本2.14或2.17也应该工作?
答案 0 :(得分:7)
你的PostgreSQL安装,或者你的操作系统安装,至少有点破坏。
猜测一下,您必须强制安装一些随机发现的RPM,而不是配置存储库并使用yum install
来安装PostgreSQL。
您不需要完全匹配的glibc版本。它必须通过公开合适的GLIBC_
符号来声明它与所需版本的兼容。
e.g。在我的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
我的glibc声明它与2.14兼容。