Wednesday, May 24, 2017

PostgreSQL: dump and restore some schemas

Dump
pg_dump --host localhost --port 5432 --username "postgres"  --clean --no-owner --no-password  --format custom --encoding UTF8 --verbose --file "/tmp/dwhmbqt_2017-05-24.dump.custom" --schema resource_db --schema crm_db --schema iot_db --schema offer_db --schema shared_db dwhmbqt
Restore
pg_restore -U postgres -d dwhmbqt /tmp/dwhmbqt_2017-05-24.dump.custom