Restore

Restore from backup file (.sql)

$ psql -U username -f filename.sql

// Restore database plain-text backup(.sql) generated by pg_dump or pg_dumpall with psql utility (psql)

Restore from custom archive backup file (.bak)

$ pg_restore -d db_name /path/to/your/file/db_name.bak -c -U db_user

// Restore database custom archive backup(.bak) using pg_restore utility (pg_restore)

pgBackrest is an awesome tool for backup creation/restore in Postgres, but it can get slow for large databases. Learn how we made Postgres backups 100x faster using EBS shapshots and pgBackrest.