Physical database backup
A physical database backup preserves or reconstructs native database files or pages together with the recovery information required by the engine.
Physical describes the stored representation, not whether capture is full or incremental. PostgreSQL 18 pg_basebackup supports both; an incremental result must be combined with its required predecessors before use. [1]
Use an engine-supported capture procedure, not an uncoordinated live file copy. PostgreSQL filesystem backups require shutdown or a documented alternative; running-server snapshots need the complete cluster and required WAL. [2]
Portability is format-specific. PostgreSQL file backups are server-version-specific, while SQLite database files are cross-platform and backward compatible within SQLite 3; forward compatibility is not complete. Check the reader and schema features. [3] [4]
SQLite's Online Backup API copies database pages through an explicit completion protocol. Physical capture is not necessarily offline capture, and completion is separate from application-level restore testing. [5] [7]
Relations
- related
- Logical database backup, Backup, Full backup, Incremental backup, Backup verification, Restore test, Point-in-time recovery, WAL archiving, SQLite Online Backup API
Advantages
- PostgreSQL base backups provide a native cluster baseline for WAL-based recovery when the required logs are retained. [6]
Limitations
- For PostgreSQL snapshots spanning data, WAL or tablespace filesystems, captures must be simultaneous or use another supported procedure. [2]
- PostgreSQL pg_basebackup includes regular configuration files in the data directory and tablespaces; configuration elsewhere needs separate backup coverage. WAL replay does not restore manual changes to postgresql.conf, pg_hba.conf or pg_ident.conf. [1, 6]
Citations
- PostgreSQL 18: pg_basebackup, full and incremental cluster capture
- PostgreSQL 18: File System Level Backup
- PostgreSQL 18: SQL Dump, comparison with file-level backup
- SQLite: Single-file Cross-platform Database and compatibility
- SQLite C API: Online Backup API and completion
- PostgreSQL 18: Continuous Archiving and Point-in-Time Recovery
- Hesela: SQLite backup completion and recovery acceptance