Where are the files for my PostgreSQL database stored? I know that with MySQL it stores a file for each table and that PostgreSQL does something different but it's got to store it's data somewhere when I turn my computer off and I'm trying to figure out where.
+3
A:
under linux here : /var/lib/postgresql/8.x/
you can change it with this command initdb -D "c:/mydb/"
Adinochestva
2009-07-16 11:59:23
+2
A:
location of specific tables/indexes can be adjusted by TABLESPACEs:
CREATE TABLESPACE dbspace LOCATION '/data/dbs';
CREATE TABLE something (......) TABLESPACE dbspace;
CREATE TABLE otherthing (......) TABLESPACE dbspace;
ymv
2009-07-16 12:14:09
A:
On Windows, the PGDATA directory that the PostgresSQL docs describe is at somewhere like C:\Program Files\PostgreSQL\8.1\data
. The data for a particular database is under (for example) C:\Program Files\PostgreSQL\8.1\data\base\100929
, where I guess 100929 is the database number.
benhoyt
2009-09-14 22:01:19