1

I try to install semver on my Postgresql 12. I installed postgis successfully and used following command to install pg-semver (semver extension) on my Centos 7 server:

yum install pg-semver

Then i ran

CREATE EXTENSION semver;

I got following error:

couldn't open extension control file /usr/pgsql-12/share/extension/semver.control : No such file or directory

I copied all files from "/usr/share/pgsql/extension/" to "/usr/pgsql-12/share/extension". Now I'm getting following error:

ERROR: ERROR: could not access file "semver": No such file or directory

UPDATE (28.02.2020):

I removed pg-semver because it delivers for PSQL 9.2. I try to now build itself by using the documentation which developer provided.

I downloaded the semver extension from https://github.com/theory/pg-semver/archive/master.zip and then unzipped. After that I run following command:

make

and get:

make: There is nothing to do for the "all" target. then:

make install

and get:

/bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644 ./semver.control '/usr/share/pgsql/extension/' /bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644 ./sql/semver--0.20.0.sql ./sql/semver--unpackaged--0.2.1.sql ./sql/semver--0.20.0--0.21.0.sql ./sql/semver--0.12.0--0.13.0.sql ./sql/semver--0.3.0--0.4.0.sql ./sql/semver--0.16.0--0.17.0.sql ./sql/semver--0.13.0--0.15.0.sql ./sql/semver--0.11.0--0.12.0.sql ./sql/semver--0.2.4--0.3.0.sql ./sql/semver--0.2.1--0.2.4.sql ./sql/semver--0.5.0--0.10.0.sql ./sql/semver--0.10.0--0.11.0.sql ./sql/semver.sql ./sql/semver--0.17.0--0.20.0.sql ./sql/semver--0.15.0--0.16.0.sql '/usr/share/pgsql/extension/' /bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 755 src/semver.so '/usr/lib64/pgsql/' /bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644 ./doc/semver.mmd '/usr/share/doc/pgsql/extension/'

then:

make installcheck

and get:

============== dropping database "contrib_regression" ============== DROP DATABASE ============== creating database "contrib_regression" ============== CREATE DATABASE ALTER DATABASE ============== installing plpgsql ============== CREATE LANGUAGE ============== running regression test queries ============== test base ... FAILED (test process exited with exit code 3)

--------------- 1 of 1 tests failed.

The differences that caused some tests to fail can be viewed in the file "/tmp/ttt/pg-semver-master/regression.diffs". A copy of the test summary that you see above is saved in the file "/tmp/ttt/pg-semver-master/regression.out".

make: *** [installcheck] Error 1

the content of regression.out:

...... ! ok 278 - minor version check ! ok 279 - Function get_semver_patch() should exist ! ok 280 - semver ! ok 281 - Function get_semver_patch() should return integer ! ok 282 - patch version check ! ok 283 - Function get_semver_prerelease() should exist ! ok 284 - semver ! ok 285 - Function get_semver_prerelease() should return text ! ok 286 - prerelease label check ! ok 287 - 1.0.0 should be in range [1.0.0, 2.0.0] ! ok 288 - 1.0.0 should not be in range [1.0.1, 2.0.0] ! ok 289 - 2.0.0 should not be in range [1.0.1, 2.0.0) ! ok 290 - 1.9999.9999 should be in range [1.0.1, 2.0.0) ! ok 291 - 1000.0.0 should be in range [1.0.0,) ! ok 292 - Should be able to work with arrays of semverranges --- 1,2 ---- \set ECHO none ! psql:sql/semver.sql:30: ERROR: could not access file "semver": No such file or directory

There is no semver.so in /usr/pgsql-12/lib/, there is a semver.so in /usr/lib64/pgsql/ but it's also for version 9.2 ?

3 Answers 3

3
+50

The reason why you are unable to install semver is twofold:

You are getting the error could not access file "semver": No such file or directory because you didn't copy /usr/lib64/pgsql/semver.so to /usr/pgsql-12/lib. However, you can't simply copy that over because of this following second reason:

yum install pg-semver will install semver from the EPEL library, which is the pre-packaged PostgreSQL version 9.2 that is shipped with CentOS 7. You installed PostgreSQL version 12 (either by compiling it yourself or downloading the PGDG repo and installing the postgresql12 package). The semver.so file that is shipped with the EPEL repo is not compatible, as it was compiled against PostgreSQL version 9.2, not version 12. If you attempt to load the EPEL semver.so into your v.12 database, you will see:

postgres=# create extension semver;
ERROR:  incompatible library "/usr/pgsql-12/lib/semver.so": version mismatch
DETAIL:  Server is version 12, library is version 9.2.

Therefore, the only way for you to install semver is by following the compilation steps detailed in the documentation:

make
make install
make installcheck
psql -c "CREATE EXTENSION semver;"

If you have not done so already (and you installed postgresql 12 via PGDG RPM), you will need to do the following in order to download and compile:

yum -y install postgresql12-devel
yum -y groupinstall "Development Tools"

You may also run into issues with compilation, like: clang: error: unknown argument: '-flto=thin' because the PGDG RPM was compiled with clang -- you can bypass that by doing:

with_llvm=no make -e
with_llvm=no make -e install
with_llvm=no make -e installcheck
psql -c "create extension semver"

Disclosure: I work for EnterpriseDB (EDB)

Sign up to request clarification or add additional context in comments.

5 Comments

Oh now i understand ht incompatible problem. But when i run "make installcheck" i get "! psql:sql/semver.sql:30: ERROR: could not access file "semver": No such file or directory"....
mmm, seems like your paste got mangled--can you update your original post with the error message (and more context, like the command(s) that you issued)? Also, I updated my post re clang errors you might see
ah ok i see. Odd -- you may want to make clean and then make again. But based on your output you may not need to do that. I see /bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 755 src/semver.so '/usr/lib64/pgsql/' -- this means that /usr/lib64/pgsql/semserver.so` should be for your postgresql12 version (unless you have some collision from some other Postgres version). Just copy that semver.so to /usr/pgsql-12/lib and try make installcheck again
I made also make clean and then started again and copied the semver.so, but i still get "! DETAIL: Server is version 12, library is version 9.2." error
If that's the case, it seems you still have Postgres 9.2 installed on your system (i.e., you probably have both v. 9.2 and v. 12 installed) -- you can verify this by looking at the output of rpm -aq | grep postgres and pg_config -- be sure to remove all traces of v. 9.2 and try your make again
1

Follow this guide to install semver:

https://pgxn.org/dist/semver/

1 Comment

I already did it. When i download zhe semver zip file and unzip it, i run make install but i'm getting error "make: *** No rule to create "install". Enough." (translated)
0

Steps to resolve “semver” extension issue of postgresql(MACOS/LINUX)

  • Download the zipped extension file from here: https://pgxn.org/dist/semver/
  • Unzip the file
  • Run these commands one by one from the command line (macOS/linux):
    cd <unzipped_folder> (ex: semver-0.32.1)
    make
    make install
    make installcheck



    FOR MAC, POSTGRES V14.8, FOR Linux provide the pg_config file location
    env PG_CONFIG=/opt/homebrew/Cellar/postgresql@14/14.8_2/bin/pg_config && make installcheck && make install
    


    any superuser of postgres db, in my case: postgres
    make install check PGUSER=<super_user>
  • Connect to postgres from command line: psql postgres
  • Run this in postgres console: CREATE EXTENSION semver;


    Hope it will work fine.
    For more see this: https://pgxn.org/dist/semver/


Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.