Where are the files for a PostgreSQL database stored?
To see where the data directory is, use this query.
show data_directory;
To see all the run-time parameters, use
show all;
You can create tablespaces to store database objects in other parts of the filesystem. To see tablespaces, which might not be in that data directory, use this query.
SELECT *, pg_tablespace_location(oid) FROM pg_tablespace;
On Windows7 all the databases are referred by a number in the file named pg_database
under C:\Program Files (x86)\PostgreSQL\8.2\data\global
. Then you should search for the folder name by that number under C:\Program Files (x86)\PostgreSQL\8.2\data\base
. That is the content of the database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With