PostgreSQL Data File Location

I use PostgreSQL on a Mac, I created several databases using the command line. I am browsing / Library / PostgreSQL / 9.2 / data and I do not see any .dat file. Am I looking for the wrong place for data files?

I used the following command: ps auxw | grep postgres | grep - -D as mentioned the default PostgreSQL database location on Linux , and it gives me the directory / Library / PostgreSQL / 9.2 / data.

Any ideas?

+7
source share
2 answers
select setting from pg_settings where name = 'data_directory' 

and

 ps auxw | grep postgres | grep -- -D 

both generate the same result. The first is through postgresql, the second is on the command line. Thanks @a_horse_with_no_name

+10
source

PostgreSQL allows you to store data in relatively arbitrary places on the file system. The default place that you can get with show data_directory is not the whole story .

+2
source

All Articles