xxxxxxxxxx
pg_restore -v --no-owner --host=localhost --port=5432 --username=__username__ --dbname=__db_name__ __dump_file_path__
xxxxxxxxxx
pg_restore --verbose --clean --no-acl --no-owner --host=localhost --dbname=db_name --username=username latest.dump
xxxxxxxxxx
pg_restore -U postgres -d database_name < C:\file_path\backup_name.sqlc -W -h localhost
xxxxxxxxxx
Dump:
cd ~
pg_dump -Fc -v --host=localhost --username=postgres --dbname=postgres -f postgresdb.dump
Restore:
pg_restore -v --no-owner --host=localhost --port=5432 --username=postgres --dbname=newdb postgresdb.dump
xxxxxxxxxx
#! /bin/bash
pg_dump -h my.host.com -p 1234 -U my_user my_database > my_dump.sql
pg_restore -h another.host.com -p 4321 - U another_user -d another_database my_dump.sql