PostgreSQL Backup and Restore Cheat Sheet/Restore schema only from archive

Restore DDL only from an archive.

Section: Selective Backup and Restore

Restore schema only from archive

bash
bash
pg_restore -h localhost -U postgres -d appdb --schema-only appdb.dump
Explanation

See summary for usage details.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Selective Backup and Restore
Dump one schema
Export one schema from a database.
OpenIn sheetbashsame section
List archive contents
Show archive items without restoring.
OpenIn sheetbashsame section
Restore one table
Restore only a named relation from an archive.
OpenIn sheetbashsame section
Restore data only from archive
Restore table data without recreating objects.
OpenIn sheetbashsame section
Parallel restore
Restore using multiple worker jobs when archive format allows it.
OpenIn sheetbashsame section
Dump one table
Export one table definition and data.
OpenIn sheetbashsame section