Thursday, August 18, 2011

postgresql - pg_restore / system-level backups /

postgresql - pg_restore

  • Until now I've been using psql to restore database dumps. The shortcoming to this approach is that you lack of any control over which parts of the dump file are you interested in the restoring (such as a single or a set of  table, a schema in particular, data only and so on). Other advantage that caught my attention is that you can restore tar files directly using this tool.


http://linux.die.net/man/1/pg_restore

system-level backups

Backing up your system by copying the data directory or other directory you've created a postgresql cluster in, is very unreliable, especially when you plan to restore such backup in another machine. The target machine must be identical (including the postgresql environment) to the origin in order for this to have any chances of succeeding. The best option is to use pg_dump / pg_dumpall.

 

 

 

No comments:

Post a Comment