13

While trying to \i create_db.sql psql throws the error:

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)

Line 123 of create_db.sql is the last line of the file, at the end of a a function definition:

$$ language plpgsql;

Versions of stuff:

$ 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>.

Do I need to have glibc exactly version 2.14 or should 2.17 work too?

Lauren
  • 131
  • 1
  • 3
  • What's the distro and version exactly - and what AMI? More importantly, how *exactly* did you install PostgreSQL? – Craig Ringer Aug 15 '14 at 01:18
  • ...? Well? You've posted a question, do you want help? – Craig Ringer Aug 18 '14 at 01:38
  • Hi @CraigRinger, two years after this question was asked I'm having exactly the same problem. I'm running Amazon Linux AMI release 2012.03, postgres 9.1.5 and glibc 2.17. I'll open a bounty for that question. – mnowotka Aug 19 '16 at 08:27

1 Answers1

7

Your PostgreSQL install, or your OS install in general, is at least somewhat broken.

At a guess, you must've force-installed some RPM you found somewhere random instead of configuring repositories and using yum install to install PostgreSQL.

You don't need an exactly matching glibc version. It just has to declare that it's compatible with the required version by exposing a suitable GLIBC_ symbol .

e.g. on my Fedora 20, with glibc 2.18, I'd have no problems running programs compiled for glibc 2.14 because:

$ /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

my glibc declares that it's compatible with 2.14.

Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
  • my glibc declares the same. Still, postgres doesn't run and in the logs I can see: ERROR: could not load library "/usr/lib64/pgsql/plperl.so": /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /lib64/libnsl.so.1) – mnowotka Aug 19 '16 at 08:30