To backup a database with pg_dump utility:
$ pg_dump -h localhost -U postgres -p 5432 pgdb1 > pgdb1_dump.sql
To restore this dump to a new database (Make sure that the new empty database is already created with "CREATE DATABASE .." command)
$ psql -h localhost -U postgres -p 5432 -d pgdb2 -f pgdb1_dump.sql
-------------------------------------------------------------------------------------------------------------------------------------------
Watch Video Format: https://youtube.com/shorts/YNV6vbUsIw0
** Connect with the author / trainer: https://suchitdba.blogspot.com/p/connect-with-author-database-trainer.html
** Email to info@shreyantech.com to get such Tip of the Day in your email
No comments:
Post a Comment