Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

A “successful” pg_restore run does not prove that every intended table reached the destination. PostgreSQL’s default is to continue after SQL errors and report an error count at the end, so start by checking the complete output and exit status. Then determine whether the table is in the archive, whether restore options filtered it out, or whether you are checking the wrong database or schema.

Start with the restore output and the database you are checking

  1. Capture the exact restore command. Record the archive file, options, target database, and the full standard output and error output. Record the process exit status as well; a completion message alone is not enough to establish that every object was restored.
  2. Confirm the destination. Make sure your SQL session is connected to the database named in the restore command, and inspect the schema where you expected the table. A table restored under a different schema can look missing if you check only the expected one.
  3. Read through all errors and warnings. By default, pg_restore continues after SQL errors and displays an error count at the end. The PostgreSQL 18 documentation describes --exit-on-error as the option that stops restoration when an error occurs while sending SQL commands to the database. See the PostgreSQL 18 pg_restore documentation.

Check whether the archive contains the table

For a non-plain-text archive, list its contents and search for the exact table name, including its schema. Use the same archive file that you passed to pg_restore:

pg_restore --list archive-file

The --list option displays the archive contents and can also produce a table-of-contents file for use with --use-list, as documented by PostgreSQL. If the table is absent from the listing, the restore could not restore that table from this archive. Focus next on how the archive was created.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If the table is absent from the archive

Review the original pg_dump command and any table or schema selection and exclusion options. pg_dump supports selecting tables and excluding tables or schemas, so an option or pattern may have omitted the missing table. PostgreSQL also cautions that a table-specific dump does not attempt to include other database objects the selected table might depend on. Consult the PostgreSQL 18 pg_dump documentation.

If the archive was created by someone else or the original command is unavailable, ask for the command or its options. Without that information, the archive listing can establish that the table is not present, but it cannot establish why it was left out.

If the table is present in the archive

Turn to the restore command, destination, and output. Check whether any of these options or modes changed what was restored:

  • --table or --schema may select only part of the archive.
  • --exclude-schema may exclude the schema containing the table.
  • --use-list may restore only entries retained in the selected table-of-contents file.
  • --data-only restores data without the table-definition behavior expected from a full restore; --schema-only does the opposite.

Compare the exact command with the archive listing, then verify the database and schema you actually inspected. If the table entry is present but the table is still missing from the intended destination, errors in the complete restore output may explain what happened.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Restore a table selectively without overlooking related objects

After identifying the archive entry and the correct destination, you can use restore selection options to address the missing object. Do not assume that selecting a table automatically restores all its related objects: PostgreSQL documents that pg_restore --table does not include subsidiary objects such as indexes. Inspect the archive listing and select the required entries as appropriate. The pg_restore documentation describes the available options.

Before using any destructive cleanup or drop operation, protect the existing destination and its backup. A missing table alone does not establish that dropping objects is necessary, and the right recovery depends on what is already in the database.

Use the archive listing to choose the next check

What you find What it points to Next check
The exact table entry is absent from pg_restore --list The table is not in this archive; investigate dump-time table/schema selection or exclusions. Review the original pg_dump command and its selection options.
The table entry is present, but the table is not where expected Restore filters, restore mode, destination database/schema, or a reported SQL error remain possible causes. Compare the restore command with the archive list, confirm the destination, and inspect the full output.

The archive listing narrows the diagnosis, but it does not identify the cause by itself. Without the archive, original dump and restore commands, full output, and intended destination, the specific cause cannot be determined.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What to include when asking for help

  • The exact pg_dump and pg_restore commands, with credentials or other secrets removed.
  • The archive format and the relevant lines from pg_restore --list.
  • The complete restore output and process exit status.
  • The intended database and schema, and the database and schema where you looked for the table.
  • The PostgreSQL client version used for the restore, so the options can be checked against its documentation.

For broader background on PostgreSQL backup and recovery workflows, see the official PostgreSQL 18 Backup and Restore documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.