Postgres DB manage

Postgres Database
> backup and restore can be done using comanndline

> pg_dump

pg_dump -h localhost -U "username" -W -F t "database_name" > "database_file_generate.tar"


> pg_restore

pg_restore -h localhost -U "mykart_user" -W -F t -d "database_name" generated_db_file.tar

-h localhost - the database hostname
-U username - the database username
-W - force pg_dump for a password before connecting to the database.
-F t - the format of the output[ t is for tar file]

Share this

Related Posts

Previous
Next Post »