← All guides

pg_restore errors, decoded (and which ones to ignore)

role does not exist, must be owner of extension, already exists — the pg_restore errors that matter and the ones that are noise.

Usually ignorable

error: role "app_admin" does not exist
error: must be owner of extension pgcrypto

Ownership/privilege statements referencing roles that only existed on the source. Restore with --no-owner --no-privileges and these disappear. Similarly extension "pg_stat_statements" is not available on a vanilla target usually costs you monitoring counters, not data.

Never ignorable

error: invalid byte sequence for encoding "UTF8"
error: could not read from input file: end of file
error: unexpected message type 0x58 during COPY

Truncated or corrupt archive, encoding mismatch, or a dump that was broken at creation. The backup is bad. If you see these on a restore TEST, celebrate — you found out before you needed it.

Triage pattern

Run with --exit-on-error off (default), capture stderr, then classify every error: line: privileges/ownership → note and move on; missing extension → decide if you need it; anything touching data (COPY, encoding, EOF) → the backup fails. Firedrill's restore_exit check automates exactly this classification with an allow-list, and records every ignored warning in the report.

A backup you've never restored is a hope, not a backup.

Firedrill restore-tests every backup it takes — on real infrastructure, with the report to prove it.