Postgres Backup Commands Backup pg_dump -U postgres -W -O -x -c -h localhost postgres > script.sql Restore psql -U postgres -W -h localhost postgres < script.sql