Category: Postgres
You can display the location for the Postgres data directory on Linux or macOS using the following command:
psql -U postgres -c 'SHOW data_directory'
Sample output:
data_directory
--------------------------------------------------------------
/Users/joebloggs/Library/Application Support/Postgres/var-12