First we add an OS user. This user will be used to start/stop/restart the database. This user will also be the superuser for the cluster. The following command has to be executed as root or with
The new user need not be named
postgres. It can be
mydba, or anything we fancy.
Next, we create a directory that will be the base directory for the new cluster. This could be anywhere. A standard location can be
/usr/local/pgsql/data. However, you might want to have the database cluster on a separate partition. In the event of an OS and associated file system crash, your database data remains intact. It can also be that you want to use faster spinning disks or Solid State Disks for the database ...