I am setting up a POSTGRESQL on a UBUNTU 16.04 server:
I followed the explanation given here, I did: The install:
sudo apt-get install postgresql postgresql-contrib`
The setup of postgres user and password:
sudo -u postgres psql postgres \password [postgres password]
At that point the command
Then before creating any SCHEMA, I followed up some guidelines to set up a new data directory for POSTGRES under
/srv/datadisk01/database, datadisk01 being a harddrive meant to store and use the database.
I changed the owner of
postgres user with
/usr/lib/postgresql/9.5/bin/initdb -D /srv/datadisk01/database, which worked.
Then I ran
sudo service postgresql stop. I updated the file
data_directory = ‘/var/lib/postgresql/9.5/main’
data_directory = ‘/srv/datadisk01/database’
sudo service postgresql start.
I stopped there and switched to other topics settings not regarding POSTGRES.
Later on (and a reboot of the machine), command
postgres fails and returns:
postgres: command not found
I can look how to re-configure the environment variable to make it work and I will, but I wonder if there is a reason that the command availability disappeared from the environment variable after the implementation of a custom data directory?