Skip to content

Instantly share code, notes, and snippets.

@zernel
Created September 14, 2012 05:40
Show Gist options
  • Save zernel/3720010 to your computer and use it in GitHub Desktop.
Save zernel/3720010 to your computer and use it in GitHub Desktop.
Backup the database
导出数据库pg_dump -Fc mydb > db_name.dump
导入数据库 pg_restore -d mydb db_name.dump
导出 pg_dump mydb > db_name.sql
表导出 pg_dump database -t table > table.sql
加上' -a '可只到导出表内容,不导出表结构
导入 psql database < xx.sql
二进制导出 pg_dump -Fc mydb > db_name.dump
二进制导入 pg_restore -d mydb db_name.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment