Reputation: 85
There are two versions of PostgreSQL installed in my Mac: 9.6 and 10.1. Currently, when I use the psql command, it's using 10.1 version of the database. I want to figure out the location of the data directory for the latest version. The following command returns the filepath for the version 9.6, not 10.1.
ps auxwww | grep postmaster
What should my terminal command be to get the data directory of the latest version?
Upvotes: 0
Views: 192
Reputation: 51466
https://www.postgresql.org/docs/current/static/storage-file-layout.html
PG_VERSION A file containing the major version number of PostgreSQL
so to find all possible $PGDATA
, run as root:
find / -name PG_VERSION
Upvotes: 1