Easiest way of shutting down a PostgreSQL server on Ubuntu According to pg_lsclusters I have 2 servers running on Ubuntu 14.04:

    Ver Cluster Port Status Owner    Data directory               Log file
    9.1 main    5432 online postgres /var/lib/postgresql/9.1/main /var/log/postgresql/postgresql-9.1-main.log
    9.3 main    5433 online postgres /var/lib/postgresql/9.3/main /var/log/postgresql/postgresql-9.3-main.log


What is the easiest way of shutting down the 9.1 server forever?

Using:

    $/usr/lib/postgresql/9.1/bin/pg_ctl stop


I get the error:

    pg_ctl: kein Datenbankverzeichnis angegeben und Umgebungsvariable PGDATA nicht gesetzt


(no database directory given and environment variable PGDATA not set)

What is the meaning of this error?
I decided to go the route of a fresh install. So instead of trying to figure out what postgresql-command will shut down the server I used:

   sudo apt-get purge postgresql-9.1


and:

   sudo apt-get purge postgresql-9.3


A fresh install might be an easier solution to some of my other problems I had since upgrading to Ubuntu 14.04.

I found this at:


https://askubuntu.com/questions/451569/postgresql-broken-after-14-04-despite-succesful-pg-upgrade-solved