How to see where PostgreSQL stores the database?

You can execute this query to show your database directories:

SELECT
	setting
FROM
	pg_settings
WHERE
	name = 'data_directory';

or this query:

SHOW data_directory;

Note that you have to be a superuser to see.


Need a good GUI tool for PostgreSQL? Check out TablePlus. It’s native, beautiful, and available for free.

Download TablePlus for Mac.

Not on Mac? Download TablePlus for Windows.

On Linux? Download TablePlus for Linux

Need a quick edit on the go? Download TablePlus for iOS.

TablePlus GUI Tool PostgreSQL