I'm on Debian 8 and want to have another than the default directory for my databases. I have a vanilla install of PostgreSQL 9.4 (so no user databases yet). I found this http://climber2002.github.io/blog/2015/02/07/install-and-configure-postgresql-on-ubuntu-14-dot-04/ about configuring a new data directory. Is this the correct way for doing this (or not)?
Thanks.
Yes. Stop the server service postgresql stop
, create the new directory and chown
it to postgres, edit /etc/postgresql/9.4/main/postgresql.conf
changing data_directory
to the new directory. Initiate the directory with initdb -D /new_dir
and then restart the postgresql server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With