PostgresΒΆ

Note

In these examples, green is the live database.

Note

In these examples, the owner name is the same as the database name.

List current databases:

psql -U postgres -c "\l"

Backup database:

pg_dump -U postgres green -f ~/repo/temp/out.sql

Restore data (from green to the empty blue database):

psql -U blue -d blue -f out.sql 2> out.log

Important

Remember to check out.log.