|
 
- 帖子
- 758
- 精华
- 1
- 积分
- 4825
- 性别
- 男
- 在线时间
- 319 小时
- 注册时间
- 2008-3-6
- 最后登录
- 2012-1-9
|
楼主
发表于 2011-1-19 12:04
| 只看该作者
Dump all global objects, such as users and groups (don't know if they were missing in your dump):
pg_dumpall -g -U postgres > globals.sql
Dump schema of database:
pg_dump -Fp -s -v -f db-schema.sql -U postgres dbname
Dump contents of database:
pg_dump -Fc -v -f full.dump -U postgres dbname
Now restore.
psql -f globals.sql
psql -f schema.sql dbname
pg_restore -a -d dbname -Fc full.dump |
|