Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data files for postgresql

Status
Not open for further replies.

totti24

Programmer
Aug 2, 2002
32
MY

hi. it's me again =). can i know where is the data files for postgresql databases are stored? as i know when i do pg_dump, it's asking me to dump the path /usr/local/pgsql/data'.
but inside the directory, i din c any meaningful data file names? thanks in advance. as for the pg_dump problem i manage to solve it. eventually the latest version of pg_dump was stored in the /usr/bin directory. so i just use that version of pg_dump and BOOMMM i manage to backup my db.
 
Hi totti24,

By default your db files will be in /var/lib/pgsql/data

LelandJ Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
It depends on your installation. Most Linux binaries will use /var/lib/pgsql/data as the datafile location, but when you compile from source, the default location is /usr/local/pgsql/data. But really, you won't find any meaningful datafile names in there (nor should you try to do anything with these files), because those files are meant to be managed by PostgreSQL internally.

pg_dump doesn't really need to know where the datafiles are, anyway. You can tell it anywhere you want to dump your data, but I recommend NOT dumping it in /usr/local/pgsql/data.

Code:
pg_dump -f /your_directory/yourfile.sql databasename
-------------------------------------------

PHP/Perl/SQL/Javascript --
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top