0

On sudo -H pgxn install semver, ERROR about wrong PostgreSQL version (it is v10 not v12),

INFO: best version: semver 0.20.3
INFO: saving /tmp/tmpba6hta5a/semver-0.20.3.zip
INFO: unpacking: /tmp/tmpba6hta5a/semver-0.20.3.zip
INFO: building extension
gcc -Wall -Wmissing-prototypes -Wpointer-arith... src/semver.c: In function ‘tail_cmp’:
src/semver.c:440:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   char *dot = ".";
   ^
gcc -Wall -Wmissing-prototypes -...
/usr/bin/install -c -m 644 .//doc/semver.mmd '/usr/share/doc/postgresql-doc-12/extension/'

INFO: installing extension
/bin/mkdir -p '/usr/share/postgresql/12/extension'
/bin/mkdir -p '/usr/share/postgresql/12/extension'
/bin/mkdir -p '/usr/lib/postgresql/12/lib'
/bin/mkdir -p '/usr/share/doc/postgresql-doc-12/extension'
/usr/bin/install -c -m 644 .//semver.control '/usr/share/postgresql/12/extension/'
/usr/bin/install -c -m 644 .//sql/semver--0.20.0.sql ...

I try also to fix "postgresql headers", by this clue using sudo apt install postgresql-server-dev-10, but no effect.

I was using the pgxn.org extensions, that has no obvious "installation Guide" on its home. Seems that the Guide is pgxn.github.io/pgxnclient, but it say nothing about change PostgreSQL configs (but Pg Guide about extend-pgxs perhaps say something).


More details on json_fdw/issues and this other question.


ENV details

  • on psql "postgres://postgres:passwd@localhost/myBase" -c "select version()" = PostgreSQL 10.12

  • old server UBUNTU 16 LTS

  • psql --version = 12.2 (but SQL is 10.12!)

  • pgxn installed by sudo easy_install pgxnclient.
    redo by sudo -H pip install --upgrade pgxnclient
    pgxn --version = pgxnclient 1.3

  • for json_fdw package prepared, before pgxn install, with sucess sudo apt install zlib1g-dev libyajl-dev.

Seems the real problem is a PostgreSQL version confusion: the two exists, ls /usr/share/postgresql/10/extension and ls /usr/share/postgresql/12/extension

2
  • how did you fix this? Commented May 12, 2020 at 14:21
  • Hi @lightweight, sorry, abandoned... pgxn seems not "super reliable", it depends on some support, that I not have for little projects. Commented May 12, 2020 at 21:08

1 Answer 1

1

The installation worked fine, the warning is about a code bug in semver.

The extension is built and installed with the PostgreSQL v12 installation on your machine, because the pg_config found on the PATH is the one from v12. If you want to build and install the extension with v10, make sure the pg_config from v10 is first on the PATH.

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

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.