Skip to content

Instantly share code, notes, and snippets.

@asleepysamurai
Created June 1, 2013 15:56
Show Gist options
  • Save asleepysamurai/5690830 to your computer and use it in GitHub Desktop.
Save asleepysamurai/5690830 to your computer and use it in GitHub Desktop.
Install plv8 on Ubuntu
  1. Install and configure Postgres [https://library.linode.com/databases/postgresql/ubuntu-12.04-precise-pangolin]
  2. Download latest stable version of plv8 [https://code.google.com/p/plv8js/wiki/PLV8]
  3. Extract plv8.zip and cd into it.
  4. sudo apt-get install subversion
  5. sudo make static
  6. Copy plv8.so to /usr/lib/postgres/9.1/lib
  7. Copy plv8--(version).sql and plv8.control to /usr/share/postgres/9.1/extension
  8. psql -d dbName
  9. CREATE EXTENSION plv8;
  10. Repeat 6-8 for plls (livescript) and plcoffee (coffeescript) if required
@thanderoy
Copy link

@ArjixWasTaken Too late but thanks. For posterity now. 😄 💪

@jinguo-yin
Copy link

@ArjixWasTaken thank you very much; successful make plv8

@bestpractice116
Copy link

lightening@lightening-virtual-machine:~/Work/bustabit/webserver/plv8$ make
g++ -DJSONB_DIRECT_CONVERSION -Ideps/v8-cmake/v8/include -std=c++17 -Wall -std=c++17 -fno-rtti -O2 -fPIC -Wall -Wno-register -xc++ -I. -I./ -I/usr/include/postgresql/17/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -fPIC -c -o plv8.o plv8.cc
In file included from plv8.cc:8:
plv8.h:20:10: fatal error: postgres.h: No such file or directory
   20 | #include "postgres.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:91: plv8.o] Error 1

Can anyone help with this issue?
Please give me some advice.

@ArjixWasTaken
Copy link

@bestpractice116 you need to install the dev headers for postgres, if you are on debian/ubuntu you can install postgresql-server-dev-16 for postgres 16

@jinguo-yin
Copy link

jinguo-yin commented Jun 5, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment