INFORMATICS

The Best

Postgresql – Possible backup corruption using pg_dump only with compress parameter

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

Postgresql – Possible backup corruption using pg_dump only with compress parameter

the command can be used to backup the database in postgresql

pg_dump -Z 1 db_name > backup
where -Z - compression level
db_name - database name
backup - backup file name

Restoring: psql -U username -d dbname < filename.sql -- For Postgres versions 9.0 or earlier psql -U username -d dbname -1 -f filename.sql or pg_restore -U username -d dbname -1 filename.dump Postgresql – How to pg_restore In your pg_dump, specify the -F t flag. This tells pg_dump to create the backup in tar format

make backup with commang:
pg_dump -U postgres -h /tmp -Ft -b -C mydb > file_db.tar

When I want to restore from backup, i give error.

pg_restore -U postgres -d template1 -v -C < file_db.tar

Search