{
  "slug": "logical-backup",
  "term": "Logical database backup",
  "aliases": [
    "logical backup"
  ],
  "definition": "A logical database backup represents selected schema objects and data as an export that a compatible engine can reconstruct instead of copying native storage pages.",
  "note": "Logical describes the representation, not the packaging. pg_dump produces SQL scripts for psql or archives for pg_restore. A binary or compressed archive is still logical. It covers one database; definitions of cluster-wide roles and tablespaces need separate coverage. [pg-dump]\n\nPostgreSQL dumps generally support migration to newer server versions and different architectures. This is not a promise of compatibility with every engine or version. [pg-sql-dump]\n\nA pg_dump export cannot serve as a base for WAL replay. Continuous archiving needs a suitable physical base and the required WAL sequence. [pg-pitr]\n\nSQLite's .dump exports SQL for reconstruction. Neither an export's label nor successful import proves that application identities and dependencies survived; test the required behavior. [sqlite-cli] [hesela-backup-evidence]\n\nA stable export snapshot is not automatically serializable. For a reporting copy of a changing PostgreSQL database, pg_dump --serializable-deferrable waits for a suitable snapshot. PostgreSQL documents no benefit for dumps used only for disaster recovery. With no read-write transactions active at startup it makes no difference; otherwise startup may be delayed for an indeterminate time. [pg-dump]",
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-29",
  "advantages": [
    {
      "text": "PostgreSQL archive dumps support selecting objects for restoration.",
      "citationIds": [
        "pg-dump"
      ]
    }
  ],
  "limitations": [
    {
      "text": "PostgreSQL pg_dump uses a consistent snapshot of one database, but pg_dumpall invokes it separately for each database; those snapshots are not synchronized. Recovery dependencies spanning databases need a separate coordination plan.",
      "citationIds": [
        "pg-sql-dump"
      ]
    }
  ],
  "related": [
    "physical-backup",
    "backup",
    "full-backup",
    "backup-verification",
    "restore-test",
    "point-in-time-recovery",
    "sqlite-online-backup",
    "snapshot-isolation",
    "serializability"
  ],
  "citations": [
    {
      "id": "pg-dump",
      "title": "PostgreSQL 18: pg_dump, formats and object scope",
      "url": "https://www.postgresql.org/docs/18/app-pgdump.html",
      "accessed": "2026-10-29"
    },
    {
      "id": "pg-sql-dump",
      "title": "PostgreSQL 18: SQL Dump, portability and pg_dumpall consistency",
      "url": "https://www.postgresql.org/docs/18/backup-dump.html",
      "accessed": "2026-10-29"
    },
    {
      "id": "pg-pitr",
      "title": "PostgreSQL 18: Continuous Archiving and Point-in-Time Recovery",
      "url": "https://www.postgresql.org/docs/18/continuous-archiving.html",
      "accessed": "2026-10-29"
    },
    {
      "id": "sqlite-cli",
      "title": "SQLite CLI: converting a database to SQL text",
      "url": "https://www.sqlite.org/cli.html#converting_an_entire_database_to_a_text_file",
      "accessed": "2026-10-29"
    },
    {
      "id": "hesela-backup-evidence",
      "title": "Hesela: backup verification and restored application identity",
      "url": "https://hesela.com/analyses/backup-verification-is-not-a-restore-test/",
      "accessed": "2026-10-29"
    }
  ]
}
