Cluster creation

It is highly advised to make a backup of the following directories:

  • /var/lib/postgresql/9.1
  • /etc/postgresql/9.1

Once we have that backup done, create the new cluster:

#                                           <version> <cluster>
(postgres@host)_$: pg_createcluster --start    9.1      main

# Create a cluster with a certain encoding, collation, etc.
(postgres@host)_$: pg_createcluster --start -e utf8 --lc-collate en_US.UTF-8 --lc_ctype en_US.UTF-8  9.1  main

After having created the new cluster we have to check

  • /etc/postgresql/9.1/main/postgresql.conf: Configuration will have changed
  • /etc/ssl/certs/ssl-cert-snakeoil.pem: User postgres must have reading permission.
  • /etc/ssl/private/ssl-cert-snakeoil.key: User postgres must have reading permission.

Cluster removal

#                                        <version> <cluster>
(postgres@host)_$: pg_dropcluster --stop    9.1      main