Installing PostgreSQL

July 11, 2016 | Posted in PostgreSQL

These are the steps for installing PostgreSQL on an Ubuntu 14.04 server

sudo apt-get install postgresql postgresql-contrib

sudo su - postgres
export PGDATA=/var/lib/postgresql/9.3/main
/usr/lib/postgresql/9.3/bin/initdb
exit

sudo nano /etc/postgresql/9.3/main/pg_hba.conf # Change auth for user `postgres` to trust
sudo service postgresql restart

sudo su postgres
psql
alter user postgres with password 'secure_password';
\q
exit

sudo nano /etc/postgresql/9.3/main/pg_hba.conf # Change auth for user `postgres` to md5
sudo service postgresql restart

Related Posts

27 Feb 2017 » Provisioning an ubuntu server for Django, Postgres, NGINX

20 Apr 2015 » Postgres backup and recovery

02 Apr 2015 » PostgreSQL module ltree

04 Sep 2014 » Forwarding port to a PostgreSQL server