Find the location of Postgres data directory

Sudhakar Rayavaram
TarkaLabs TIL
Published in
1 min readJun 1, 2019

In Postgres, it is not easy to find the location of the data folder because it can be overridden in multiple configuration files and also can be passed as a parameter when starting postgres server

However, there is an easy way to find it out from postgres interactive terminal by running the following command

show data_directory;

data_directory
— — — — — — — — — —
/var/lib/pgsql95/data
(1 row)

--

--

Sudhakar Rayavaram
TarkaLabs TIL

[su-docker] Software plumber, health and wellness enthusiast, digital artist, data visualization lover & …