PostgreSQL bietet mehrere Backup-Methoden — logische Backups (pg_dump) und physische Backups (Base Backup + WAL für Point-in-Time Recovery). Eine solide Backup- und Wiederherstellungsstrategie ist essentiell zum Schutz vor Datenverlust, und entscheidend: Backups müssen getestet werden.
Logische Backups — pg_dump
pg_dump -U user -d mydb -F c -f backup.dump
pg_dump -U user -d mydb > backup.sql
pg_dumpall > all.sql
pg_restore -U user -d mydb backup.dump
psql -U user -d mydb -f backup.sql
