PostgreSQL dump and restore database command

For my own records. Dump:

pg_dump -U superuser -C -o database > database

And then the restore (postgres should be the template db):

psql postgres superuser < database 

Leave a Reply