3

How to dump and restore a PostgreSQL database

 3 years ago
source link: https://dev.to/rodrigocnascimento/how-to-dump-and-restore-a-postgresql-database-3da
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How to dump and restore a PostgreSQL database

pg_dump -h HOST -p PORT -U USER dbname > dbname.sql

Enter fullscreen mode

Exit fullscreen mode

To restore

psql -h HOST -p PORT -U USER dbname < dbname.sql

Enter fullscreen mode

Exit fullscreen mode


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK