Skip to content

Instantly share code, notes, and snippets.

@benjie
Created April 1, 2016 09:15
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save benjie/5120a175267dfb96adcf1ee2929033a6 to your computer and use it in GitHub Desktop.
Save benjie/5120a175267dfb96adcf1ee2929033a6 to your computer and use it in GitHub Desktop.
Easy plv8 on OSX

Heroku runs plv8 v1.4.2 (checked on 1st April 2016). On OSX it's easiest to install v1.4.3 since that allows V8 3.15 which is available via homebrew. (1.4.2 wants V8 3.14.5).

To install:

brew install v8-315
pip install pgxnclient
LIBRARY_PATH="/usr/local/opt/v8-315/lib" CPATH="/usr/local/opt/v8-315/include" pgxnclient install plv8=1.4.3

To test it worked:

$ psql
# CREATE EXTENSION plv8;
CREATE EXTENSION
# DO $$ plv8.elog(NOTICE, "Hello World") $$ LANGUAGE plv8;
NOTICE:  Hello World
DO
# DROP EXTENSION plv8;
DROP EXTENSION
# 
@benjie
Copy link
Author

benjie commented May 13, 2018

UPDATE: if installing newer plv8 against newer Postgres on newer OSX then do NOT install v8 from homebrew - it's out of date and causes issues. Uninstall it before continuing:

brew uninstall v8
brew uninstall v8-315

You can then follow the plv8 install instructions and they should work, plv8 will automatically download v8 as part of the make process 👍

https://plv8.github.io/#building

@braco
Copy link

braco commented Jan 17, 2023

@benjie 4 years later, this thread is a top result for the subject. Still true in your opinion?

@benjie
Copy link
Author

benjie commented Jan 18, 2023

🤷‍♂️ I don’t use plv8 any more

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