catalinmarinescu
8/31/2018 - 9:51 AM

Postgres usefull commands

# copy database between servers without temp file
pg_dump -C -h localhost -U localuser dbname | psql -h remotehost -U remoteuser dbname

# restore database
pg_restore -h localhost -U {user} -W -d {dbname} < {path/to/sql/dump}