tags:

views:

731

answers:

4

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
+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
+4  A: 

PostgreSQL's docs have some information on this topic:

http://www.postgresql.org/docs/8.4/static/storage.html

jwp
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