INFORMATICS

The Best

Przełącznik języka

Zaproś mnie na KAWE

Jeżeli podoba Ci się strona i chcesz wspomóc projekt!

Postaw mi kawę na buycoffee.to

This Site

Płatnik

CMS

Hardware

Uncategorised

Emulators

Powershell

Storage Array

DNS

Antivirus program

Licznik

3.png1.png3.png0.png1.png9.png6.png
Today447
Yesterday890
This week7545
This month27409
Total3130196

Visitor Info

  • IP: 18.191.89.126
  • Browser: Unknown
  • Browser Version:
  • Operating System: Unknown

Who Is Online

6
Online

piątek, 28 luty 2025 08:33

Postgresql – Possible backup corruption using pg_dump only with compress parameter

Gwiazdka nieaktywnaGwiazdka nieaktywnaGwiazdka nieaktywnaGwiazdka nieaktywnaGwiazdka nieaktywna
 

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