nkhorman / json_fdw

PostgreSQL extension which implements a Foreign Data Wrapper (FDW) for JSON files.
109 stars 12 forks source link

Can I install on UBUNTU 16 LTS? #10

Open ppKrauss opened 4 years ago

ppKrauss commented 4 years ago

After command sudo pgxn install json_fdw, error:

INFO: best version: json_fdw 1.0.0
INFO: saving /tmp/tmpinndxvp9/json_fdw-1.0.0.zip
INFO: unpacking: /tmp/tmpinndxvp9/json_fdw-1.0.0.zip
INFO: building extension
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -pie -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal -I/usr/include/x86_64-linux-gnu -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o json_fdw.o json_fdw.c
In file included from json_fdw.c:15:0:
json_fdw.h:22:28: fatal error: nodes/relation.h: No such file or directory
compilation terminated.
<builtin>: recipe for target 'json_fdw.o' failed
make: *** [json_fdw.o] Error 1
ERROR: command returned 2: make PG_CONFIG=/usr/bin/pg_config all

see more details on https://stackoverflow.com/q/60598749/287948


In principle, there are maintenance updates for UBUNTU 16 LTS... It is ok?

More something? Need PATH=/usr/local/pgsql/bin/:$PATH make for UBUNTU? not clear on Guide's "Other Linux Distributions".

ppKrauss commented 4 years ago

Similar error on sudo pgxn install semver:

INFO: best version: semver 0.20.3
INFO: saving /tmp/tmp4vc8vnlk/semver-0.20.3.zip
INFO: unpacking: /tmp/tmp4vc8vnlk/semver-0.20.3.zip
INFO: building extension
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -pie -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal -I/usr/include/x86_64-linux-gnu -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o src/semver.o src/semver.c
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 -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -pie -fno-omit-frame-pointer -fPIC src/semver.o -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -L/usr/lib/llvm-6.0/lib  -L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,--as-needed  -shared -o src/semver.so
/usr/bin/clang-6.0 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2  -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal -I/usr/include/x86_64-linux-gnu -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5 -flto=thin -emit-llvm -c -o src/semver.bc src/semver.c
cp sql/semver.sql sql/semver--0.20.0.sql
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 .//sql/semver--unpackaged--0.2.1.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/postgresql/12/extension/'
/usr/bin/install -c -m 755  src/semver.so '/usr/lib/postgresql/12/lib/'
/bin/mkdir -p '/usr/lib/postgresql/12/lib/bitcode/src/semver'
/bin/mkdir -p '/usr/lib/postgresql/12/lib/bitcode'/src/semver/src/
/usr/bin/install -c -m 644 src/semver.bc '/usr/lib/postgresql/12/lib/bitcode'/src/semver/src/
cd '/usr/lib/postgresql/12/lib/bitcode' && /usr/lib/llvm-6.0/bin/llvm-lto -thinlto -thinlto-action=thinlink -o src/semver.index.bc src/semver/src/semver.bc
/usr/bin/install -c -m 644 .//doc/semver.mmd '/usr/share/doc/postgresql-doc-12/extension/

.. seems "fatal error", but not say... So testing: sudo pgxn load -d myBase semver:

INFO: best version: semver 0.20.3
ERROR:  could not open extension control file "/usr/share/postgresql/10/extension/semver.control": No such file or directory

... so, yes, was "fatal error".

ppKrauss commented 4 years ago

Using this clue: installed sudo apt install postgresql-server-dev-10, but no effect on sudo pgxn install semver, same error above, "gcc -Wall ...: In function ‘tail_cmp’: ..."

ppKrauss commented 2 years ago

For readers... The best way to import JSON is direct pg_read_file(f)::JSONB, you not need to use this project.