Postgresql Cheatsheet

Creating and Restoring backup


Create backup from a database

pg_dump database_name > database_backup.sql

Restore from a backup sql file

psql database_name < database_backup.sql