Just Code‎ > ‎

Postgres 9.2 - Installation on Ubuntu, including PLV8 Language, from source, resources used

posted Oct 29, 2012, 8:36 AM by Peter Henell   [ updated Oct 29, 2012, 8:37 AM ]
Links used to install Postgres 9.2 on ubuntu server edition.

date: 2012-10-25

This is all a mess, maybe I will clean it up if I need to install it again anytime soon.
 

 http://blog.redfin.com/devblog/2012/03/json_in_postgres.html

 http://www.postgresql.org/docs/9.2/static/functions-json.html

 http://www.postgresql.org/ftp/source/v9.2rc1/

 http://autofei.wordpress.com/2011/02/17/install-postgresql-9-0-from-source-code-at-ubuntu/

 http://sourceforge.net/apps/mediawiki/geoportal/index.php?title=Install_PostgreSQL_9.1.2

 http://code.google.com/p/plv8js/wiki/PLV8

 http://code.google.com/p/v8/wiki/BuildingWithGYP

 http://code.google.com/p/v8/wiki/UsingGit

 http://people.planetpostgresql.org/andrew/index.php?/archives/278-PLV8-is-go.html

 http://dev.chromium.org/developers/how-tos/install-depot-tools

 https://groups.google.com/forum/?fromgroups=#!topic/v8-users/X1Dtpkgm6eA


My notes for installing this

add repositories for apt:
https://help.ubuntu.com/community/Repositories/CommandLine


wget http://ftp.postgresql.org/pub/source/v9.2rc1/postgresql-9.2rc1.tar.gz
tar xvzf postgresql-9.2rc1.tar.gz

sudo ln -s /usr/bin/make /usr/bin/gmake

http://autofei.wordpress.com/2011/02/17/install-postgresql-9-0-from-source-code-at-ubuntu/

sudo apt-get install libreadline6-dev
sudo apt-get install zlib1g-dev


./configure
sudo make
sudo make install

sudo mkdir /usr/local/pgsql/data
sudo adduser postgres
sudo chown postgres /usr/local/pgsql/data
su - postgres

Then initialize the database:
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data/


Then create log directory and a sample database:
cd /usr/local/pgsql/data/
mkdir log
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >/usr/local/pgsql/data/log/logfile 2>&1 &


Create sample DB:
cd ..
bin/createdb mydb
bin/psql mydb



(optional) To start the server automatically at every boot, add: 
su -c '/usr/local/pgsql/bin/pg_ctl start -l /usr/local/pgsql/data/log/logfile -D /usr/local/pgsql/data' postgres 
to your /etc/rc.local file


Configure the postgres server to be reachable from the outside
emacs /usr/local/pgsql/data/postgresql.conf

Find this value and  and edit to allow all external IPs, Remove the # in front of the key
listen_addresses = '*'

Edit security thing:
emacs /usr/local/pgsql/data/pg_hba.conf
Add row:
host    all             all             10.99.11.0/24           trust

Download and pgAdmin install for remote admin goodness
http://www.postgresql.org/ftp/pgadmin3/release/v1.16.0/win32/


To Start the postgres service manually
/usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data/


-- ------------------------------------------------------------------------------------------
Install V8
http://code.google.com/p/plv8js/wiki/PLV8
mkdir v8
cd v8

svn checkout http://v8.googlecode.com/svn/trunk v8

sudo apt-get install gyp

cd ~/build
svn checkout http://v8.googlecode.com/svn/trunk/ v8
cd v8
export GYPFLAGS="-D OS=linux"
make dependencies
make native.check -j 4 library=shared strictaliasing=off console=readline


Comments