6

After install postgres, can't create extension plv8.

I'm use: CREATE EXTENSION plv8;

I'm getting:

ERROR:  could not open extension control file "/usr/local/share/postgresql/extension/plv8.control": No such file or directory
********** Error **********

ERROR: could not open extension control file "/usr/local/share/postgresql/extension/plv8.control": No such file or directory
SQL state: 58P01

version postgres: 9.6.2 version pgAdmin4: 1.4

How to install plv8?

  • 2
    Can you give a detailed description of how you installed plv8? What is your operating system? – Laurenz Albe Apr 28 '17 at 13:05
  • https://pgxn.org/dist/plv8/doc/plv8.html#installing-plv8, btw it says PG: version 9.2, 9.3, 9.4 and 9.5 (maybe older/newer are allowed) – Vao Tsun Apr 28 '17 at 13:47
  • OS: Mac OS El Capitano I'm installing plv8 therefore guide: https://github.com/plv8/plv8/blob/master/doc/plv8.md#installing-plv8 –  Apr 28 '17 at 14:05
  • 1
    Forgot to ask, can someone else know why it does not work `brew install plv8` ? –  Apr 28 '17 at 14:16

3 Answers3

3

This should work on most platforms (https://github.com/plv8/plv8/issues/212#issuecomment-287589193):

$ easy_install pgxnclient
$ pgxnclient install plv8

It didn't work for me though. The only solution I came up with was building the library from source.

If you don't have wget installed, run:

$ brew install wget

Then run:

$ wget https://github.com/plv8/plv8/archive/v2.0.0.tar.gz
$ tar -xvzf v2.0.0.tar.gz
$ cd plv8-2.0.0
$ make static
$ make install

It worked for me.

karytka
  • 33
  • 7
3

I. Docker-images with postgres and plv8. It's free, images for Postgres 13, 14, and 15 based on Debian and Alpine are available, amd64 and arm64 architectures supported.

docker pull sibedge/postgres-plv8

Default is Alpine/last Postgres version. the complete tag list

Pay attention, that BigInt is not serializable in v8 and by default in plv8 v3.0.0 and higher BigInt numbers are converted into string(!). But if you need BigInt as numbers support, use this image with Postgres and specific version of plv8:

docker pull sibedge/postgres-plv8-bigint

II. Or, you can build images (for PostgreSQL with installed plv8) yourself with Dockerfiles:

Postgres 14.2, plv8 v3.0.0, Alpine based. size of image is 235MB.

Postgres 13.6, plv8 v3.0.0, Alpine based. size of image is 231MB.

Postgres 13.4, plv8 v2.13.15, Debian based. size of image is 351MB.

Postgres 13.6, plv8 v3.0.0, Debian based. size of image is 427MB.

III. Simple installing plv8 v3.0.0 on Debian Linux (PostgreSQL 13 must be preinstalled) :

$ git clone https://github.com/sibedge-llc/plv8-build.git
$ cd plv8-build
$ git checkout pg13-3.0.0-debian
$ sudo make install
ChelowekKot
  • 1,946
  • 1
  • 18
  • 16
0

I find a new way. Just copy and Paste! if you using postgresql version of: 9.5, 9.6 beta, 10 go this link to download package and learn what shoud you copy and where to past: https://github.com/JasperFx/marten/blob/master/documentation/documentation/admin/installing-plv8-windows.md

if you using postgresql version of: 9.3, 9.4, 9.5, 9.6, 10, 11 and 12 for downloading package you can go here: http://updates.xtuple.com/updates/plv8/win/xtuple_plv8.zip for downloading package and then copy past like has mentioned in first link

sarbaz tanha
  • 49
  • 1
  • 7
  • another link you can use it: http://www.postgresonline.com/journal/archives/379-PLV8-binaries-for-PostgreSQL-10-windows-both-32-bit-and-64-bit.htmll – sarbaz tanha Jan 25 '20 at 14:02