Recover Data from a Page Image
When only a PDU page image and database definitions remain, use RecoverISO to parse the image directly without the original PGDATA or disk. The following sections describe recovery-resource creation, data recovery and TOAST handling in detail.
I. Initialization
Preserve the image, idx and original DDL, and prepare the matching PDU program in a separate working directory. There is no need to run b; against the original data directory or start PostgreSQL.
II. Create Recovery Resources
2.1 Create PDUPlan from DDL
ds plan create /recovery-input/schema.sql /recovery-work/full.pduplan --mode=strict;
ds plan inspect /recovery-work/full.pduplan --format=tsv --output=/recovery-work/full.tsv;
ds plan check /recovery-work/full.pduplan;PDU parses DDL natively and creates a binary recovery dictionary with version and identity information. Existing Plan and inspect output are not overwritten; use new filenames.
2.2 Select Tables to Recover (Optional)
Use a UTF-8 list without BOM, with one complete schema-qualified table name per line and the correct letter case. Even when a Plan selects one table, PDU checks for other matches in the full dictionary rather than assigning pages to the selected table automatically.
ds plan select /recovery-work/full.pduplan /recovery-work/selected.pduplan --include-file=/recovery-input/tables.txt;
ds plan check /recovery-work/selected.pduplan;III. Parse the Page Image
ds recoveriso /recovery-input/source.pgiso /recovery-work/selected.pduplan;Use the complete Plan when selection is unnecessary. Recovery mode is fixed in the Plan. Specify relaxed mode at creation rather than changing it during an existing task resume.
IV. Restore TOAST Data
RecoverISO handles TOAST and performs targeted rescanning in its native recovery process. Missing external values retain unresolved records. To supplement TOAST in an existing workspace, use the same image with the following command.
ds recoverisotoast /recovery-input/source.pgiso;Main-table identification, TOAST indexing and value backfill are separate stages. Record their native states separately rather than treating the completion of one as completion of the whole recovery.
V. Handle Records Requiring Confirmation
Several tables with identical field types may decode the same pages. PDU saves these results in __ambiguous_NNN without generating COPY for a chosen target table. Use the PDU report and page locations to confirm the mapping.
See the fragment-analysis, historical-layout and attribution procedure.
VI. Continue the Recovery Task
After a normal pause, retain the original working directory, image, Plan and program identity and repeat the same command. Changed Plans, selection, modes or programs reject the old checkpoint; use a new working directory for a new plan and retain the old evidence.
After export, record native success and failure counts and original errors reported by PDU, and retain checkpoints. Resume uses native records and file metadata such as existence and size without rereading or validating exported data.
Output Files
- recoveriso_report.txt: native recovery summary and limits.
- recoveriso_offsets.tsv: source-location records.
- recoveriso_restore.sql: applicable definitions and COPY statements.
- UnresolvedToast.csv: unresolved TOAST dependencies.
Files are under restore/dropscan. Use data and evidence paths from the native report for the current run. Recovery does not automatically import into a target database.