$sudo apt-get install libv8-3.7.12.22 libv8-dev
which is, at the moment I write, the lastest libv8 release packaged. After that download
$sudo wget https://plv8js.googlecode.com/files/plv8js-20120719.tar.gz
Compile and install the library
$sudo tar zxvf plv8js-20120719.tar.gz
$cd plv8js
$sudo make
$sudo make install
$cd plv8js
$sudo make
$sudo make install
After that the file plv8.so is placed inside the directory /usr/lib/postgresql/9.1/lib, while
plv8.control and plv8--1.1.0.sql are placed inside the directory /usr/share/postgresql/9.1/extension
To make sure all is correclty installed and working, it is a good idea do a quick test.
Supposing we have already created a database called PGV8 we can use the psql command line:
$ sudo -s -u postgres
postgres$ createlang -d PGV8 plv8
in order to enable plv8 language, and
postgres$ sudo psql -d PGV8 -c "CREATE EXTENSION plv8"
in order to register the plv8 stored procedure.
If no errors are displayed, our database is ready to take advantage of this
new feauture.
Nessun commento:
Posta un commento