PostgreSQL 18 · Backup and restore

Restore a plain SQL dump

Replay a SQL script and stop at the first error.

psql -U postgres -d mydb -v ON_ERROR_STOP=1 -f mydb.sql

Official PostgreSQL 18 documentation

More backup and restore commands

All backup and restore commands · PostgreSQL 18 cheatsheet

Was this page helpful?