In ubuntu 18.04 PostgreSQL is running on the default directory /usr/lib/postgresql/ and the data directory is ‘/etc/postgresql/10/main’ To get the data directory you can run sudo -u postgres psql -c “show data_directory;” To change the data directory, first, stop the PostgreSQL service sudo service postgresql stop I mounted a ZFS volume through iSCSI protocol in my home directory /home/vignesh/pdata That will be my target directory so whenever I want to create a backup I can take the ZFS snapshot After mounting the FS, I changed to the owner to postgres vignesh@vignesh:~$ sudo chown postgres pdata Then modify the data_directory configuration…
Passionate Developer with 7 years of extensive experience working for Data center related products. Contributed and lead the efforts in Solutioning and engineering in Nimesa Technologies for developing Dataprotection and Copy data management product for Private and Public Clouds
This is my personal weblog, opinions expressed here represent my own and not those of my employer.
All content provided on this blog is for informational purposes only and i will not be liable for any errors, losses, or damages from the display or use of this information.