0

I use Centos 7 and Postgresql 12. I installed already PostGIS and created successfully its extension. I'm now tring to install semver extension with create extension semver and get following error:

ERROR: incompatible library »/usr/pgsql-12/lib/semver.so«: version does not match

According to developer this version should work with my Postgresql 12. Why am i getting this error?

Thanks!

Micheal Toru
  • 422
  • 4
  • 28
  • 1
    How did you install `semver`? It sounds like your `.so` file was built against an earlier version of Postgres. – Nick Barnes Feb 27 '20 at 22:23
  • because i want to compare software versions in my table. But it's the last version... – Micheal Toru Feb 27 '20 at 22:24
  • But where did you get the `.so` file? Even for the same version of `semver` (e.g. `0.21.0`), you need different `.so` files for Postgres 12, 11, 10, etc., and it sounds like yours was not built for Postgres 12. – Nick Barnes Feb 27 '20 at 22:42
  • i installed it via yum install pg-semver and it installs "pg-semver-0.5.0-2.el7.x86_64" – Micheal Toru Feb 27 '20 at 22:53
  • i had some troubles while installing semver, because yum puts the .so file in a different lib folder, where postgresql couldn't find it. that's why i had to manually move the semver.so file to postgresql's lib folder for extensions. (see the issue here: https://stackoverflow.com/questions/60395560/cant-install-extension-on-postgresql ) – Micheal Toru Feb 27 '20 at 22:55

1 Answers1

1

An extension's .so binaries are specific to a major release of Postgres.

If you're installing the extension through yum, there would typically be a different package for each Postgres version. For example, if you installed Postgres 12 using the postgresql12-server package, then you would install PostGIS 3.0 using the postgis30_12 package.

If the package name is just pg-semver, without a Postgres version number, then it's probably intended for your distribution's default postgresql-server package. In CentOS 7, this appears to be Postgres 9.2, so these files won't work on a Postgres 12 server.

If you can't find a PG12-specific package, you'll need to build it yourself, using the instructions here.

Nick Barnes
  • 19,816
  • 3
  • 51
  • 63