2

Is there a way someone can get the text files that make up the Database I mean the raw text files that you get when you dump the db.? I am thinking the files must be somewhere inside the data directory...How can I get them?

Utawangu
  • 195
  • 1
  • 1
  • 8
  • Does your data table have an associated tablespace? Have you checked the docs? http://www.postgresql.org/docs/8.1/static/storage.html – MAbraham1 Jun 15 '12 at 20:23

2 Answers2

4

They aren't in a text format. If you can't figure out where the raw data files are kept either by looking or reading the documentation you're unlikely to be able to make much use of them.

I think this is what's known as an XY question - try asking a question about what you're trying to achieve.

Richard Huxton
  • 18,412
  • 3
  • 31
  • 43
0

Jeff,

Your answer depends on whether you have a tablspace or not. If the database has an associated tablespace, then that will dictate where the physical files are located. A table space tells the database where to store the physical files on the disk.

All the data needed for a database cluster is stored within the cluster's data directory, commonly referred to as PGDATA (after the name of the environment variable that can be used to define it). A common location for PGDATA is /var/lib/pgsql/data. Multiple clusters, managed by different postmasters, can exist on the same machine.

For Windows, the subdirectory containing symbolic links to tablespaces is located here: C:\Program Files\PostgreSQL\9.0\data\pg_tblspc\.

You can read more on database physical storage in the PostgreSQL Documentation online, located here. The database file layout is further discussed here.

Since we're not sure exactly what you're trying to do, you will definitely want to read the incredibly-abundant PostgreSQL online documentation before you attempt to move data at the file-level. You will also want to do further research on StackOverflow, as you'll find answers such as this one that discuss transferring PostgreSQL data.

Also, have a look at the Backup and Restore documentation while you're at it.

Enjoy!

Community
  • 1
  • 1
MAbraham1
  • 1,534
  • 4
  • 25
  • 40