Installation

July 2, 2016   

Server

sudo aptitude install postgresql postgresql-server-dev-9.5 postgresql-contrib

Community Maintained Repository

This is the recommended way of installing Postgres

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install postgresql-9.4

Make Postgres listen available to other servers: sudo vi /etc/postgresql/9.5/main/postgresql.conf

listen_addresses = '*'

sudo service postgresql restart

Enable access through specific IPs network:

sudo vi /etc/postgresql/9.5/main/pg_hba.conf

host all all 10.10.29.0/24 md5
  • trust: without password
  • md5: with password
  • peer: same user logged in on the server

Clients

  • postgresql-client: recommended sudo apt-get install postgresql-client
  • pgcli provides autocompletion and highlight.
  • pgAdmin is a good GUI client, but I prefer postgresql-client to be used.


comments powered by Disqus