问题描述
在sudo -H pgxn install semver上,关于错误的PostgreSQL版本(是v10而不是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 ...
我也尝试通过此线索使用sudo apt install postgresql-server-dev-10修复"postgresql标头",但没有效果./p>
我正在使用 pgxn.org 扩展名,该扩展名没有明显的安装指南".似乎该指南是 pgxn.github.io/pgxnclient ,但它并没有说明更改PostgreSQL配置(但有关extend-pgxs的PG指南也许可以说些什么)./p>
有关 json_fdw/issues 和.
ENV详细信息
- 上的
-
= PostgreSQL 10.12
-
旧服务器UBUNTU 16 LTS
-
psql --version = 12.2(但是SQL是10.12!)
-
pgxn由sudo easy_install pgxnclient安装.
重做由sudo -H pip install --upgrade pgxnclient
pgxn --version = pgxnclient 1.3 在 pgxn安装之前为json_fdw软件包准备 -
,并且成功sudo apt install zlib1g-dev libyajl-dev.
似乎真正的问题是PostgreSQL版本混乱:这两个存在,ls /usr/share/postgresql/10/extension和ls /usr/share/postgresql/12/extension
安装正常,警告是有关semver中的代码错误.
该扩展名是在您的计算机上与PostgreSQL v12安装一起构建和安装的,因为在PATH上找到的pg_config是v12中的扩展名.如果要使用v10构建和安装扩展,请确保v10中的pg_config首先在PATH上.
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.3for 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
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.
这篇关于如何使用正确的PostgreSQL版本安装pgxn?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!