Identify Unknown Data Files

When PostgreSQL data files remain available but file-to-table mappings are incomplete, use PDU to sample files and identify candidates from preserved table definitions. The following sections describe single-file identification, batch identification and export in detail.


I. Initialization

Keep data files, schema evidence and working directories separate. With an existing restore/tab.config, specify a file directly. To generate definitions from a readable database directory, use scan manual;. Disk recovery and scan manual do not require b; first.

scan manual;

II. Analyze a Single Data File

2.1 Use the Default Definition File

ds probe /recovery-input/datafiles/12345;

PDU samples the file using restore/tab.config. Retain all decodable candidates and reasons for unmatched input. Successful sampling is not a complete file export.

2.2 Use an Explicit Definition File

ds probe /recovery-input/tab.config /recovery-input/datafiles/12345;

III. Analyze Data Files in a Batch

ds probebatch /recovery-input/tab.config /recovery-input/datafiles;
ds probebatch valid /recovery-input/datafiles;

Batch identification retains candidate inventories. valid generates the restore/dropscan/datafile.txt file whitelist. Retain tab.config, tab.fullmeta and native candidate files when complete schema candidates are needed.


IV. Confirm Schema Candidates

ds probe show;

Several tables with identical field types may match the same file. Confirm the table using source information, field meanings, catalog relationships and business records. A definition that can decode the file is not enough on its own.


V. Export Data

ds unload tab 12345;

# Or export all selected files:
ds unload all;
ds log;

Export uses selections in probe_candidates.json and probe_map.txt. Files with native completion records are skipped accordingly. If sources, definitions or page size change, retain the old task and create a new working directory.


VI. Handling TOAST Files

Preserve the main table, TOAST files and segments together. Probe-generated TOAST indexes and page-size records must match the export program. Retain original reasons for missing fragments and decoding failures. A main-table sample match does not prove complete external values.


Output Files

  • restore/dropscan/probe_candidates.json: schema candidates and file selections.
  • restore/dropscan/probe_map.txt: mappings and page size used for export.
  • unload/*.csvN: exported data files; use the paths reported by PDU.
ds unload copy;

ds unload copy generates COPY scripts. The user decides separately whether to import into a target database; no trial import runs automatically.

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.

PostgreSQL 文档