0

I am trying to install PLV8 extension (JavaScript Procedural Language for PostgreSQL) in my PostgreSQL 11 Ubuntu Server 16 and having a hard time. The PostgreSQL 11 was installed using PostgreSQL's http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main repository through apt install command.

My attempts to compile from source code while being guided by the official documantation failed. The PLV8 source code I am targeting is this one https://github.com/plv8/plv8/archive/v2.3.11.tar.gz.

While running make, the machine throws the following error

root@ubuntuLocal:/home/ubuntu/plv8/plv8-2.3.11# make
cat: '/usr/include/postgresql/11/server/pg_config*.h': No such file or directory
/bin/sh: 1: test: -ge: unexpected operator
/bin/sh: 1: test: -lt: unexpected operator
/bin/sh: 1: test: -lt: unexpected operator
/bin/sh: 1: test: -lt: unexpected operator
/bin/sh: 1: test: -lt: unexpected operator
Makefile.shared:183: /usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
make: *** No rule to make target '/usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk'.  Stop.

And while using make PG_CONFIG=/usr/lib/postgresql/11/pg_config it take ages to compile then throws the following:

Updating Clang to 318667-1...
Downloading prebuilt clang
Downloading https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-318667-1.tgz .......... Done.
Creating directory /home/ubuntu/plv8/plv8-2.3.11/build/v8/third_party/llvm-build/Release+Asserts
clang 318667-1 unpacked
Hook '/usr/bin/python v8/tools/clang/scripts/update.py' took 71.09 secs
Running hooks:  95% (22/23) regyp_if_needed
________ running '/usr/bin/python v8/gypfiles/gyp_v8 --running-as-hook' in '/home/ubuntu/plv8/plv8-2.3.11/build'
GYP is now disabled by default in runhooks.

If you really want to run this, either run
`python gypfiles/gyp_v8` explicitly by hand
or set the environment variable GYP_CHROMIUM_NO_ACTION=0.
Running hooks: 100% (23/23), done.
[detached HEAD 3d27d55] [ios] Various build fixes for Xcode 10.
 Author: Justin Cohen <justincohen@google.com>
 Date: Tue Jun 5 15:30:25 2018 +0000
 2 files changed, 36 insertions(+), 11 deletions(-)

Hint: You can raise verbosity (-vv) to see the output of failed commands.

Traceback (most recent call last):
  File "tools/dev/v8gen.py", line 304, in <module>
    sys.exit(gen.main())
  File "tools/dev/v8gen.py", line 298, in main
    return self._options.func()
  File "tools/dev/v8gen.py", line 166, in cmd_gen
    gn_outdir,
  File "tools/dev/v8gen.py", line 208, in _call_cmd
    stderr=subprocess.STDOUT,
  File "/usr/lib/python2.7/subprocess.py", line 574, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/usr/bin/python', '-u', 'tools/mb/mb.py', 'gen', '-f', 'infra/mb/mb_config.pyl', '-m', 'developer_default', '-b', 'x64.release', 'out.gn/x64.release']' returned non-zero exit status 1
Makefile:35: recipe for target 'build/v8' failed
make: *** [build/v8] Error 1

Then my attempts to install from PGXN have failed too, this is the error:

ubuntu@ubuntuLocal:/etc/apt/sources.list.d$ sudo pgxn install plv8
INFO: best version: plv8 2.3.11
INFO: saving /tmp/tmp43TbRw/plv8-2.3.11.zip
INFO: unpacking: /tmp/tmp43TbRw/plv8-2.3.11.zip
INFO: building extension
cat: '/usr/include/postgresql/11/server/pg_config*.h': No such file or directory
/bin/sh: 1: test: -ge: unexpected operator
/bin/sh: 1: test: -lt: unexpected operator
/bin/sh: 1: test: -lt: unexpected operator
/bin/sh: 1: test: -lt: unexpected operator
/bin/sh: 1: test: -lt: unexpected operator
Makefile.shared:183: /usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk: No s                                                                uch file or directory
make: *** No rule to make target '/usr/lib/postgresql/11/lib/pgxs/src/makefiles/                                                                pgxs.mk'.  Stop.
ERROR: command returned 2: make PG_CONFIG=/usr/bin/pg_config all
  • How did you install 11? Did you compile it yourself, or use a package manager if the latter which one and which repository? – jjanes Jun 5 at 10:23
  • Did you install the PostgreSQL "devel" package? – Laurenz Albe Jun 5 at 10:34
  • @jjanes I have used "apt install". Ubuntu's default xenial repository. – Tiago Stapenhorst Martins Jun 5 at 16:54
  • @LaurenzAlbe I haven't. Why should I? – Tiago Stapenhorst Martins Jun 5 at 16:54
  • Xenial's default repository offers 9.5, not 11. (It also offers postgresql-9.5-plv8 directly). It seems you may have some kind of mix-and-match broken installation. – jjanes Jun 5 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.