辽宁卫视高清直播,广州医科大学首页,今日柴油价格查询
postgresql数据库备份与恢复
pg_dump
1. 备份整个数据库:pg_dump -U nsc -d nsc -C -F c -f nsc.sql
2. 备份一张表内容:pg_dump -U nsc -d nsc -a -F c -t mail_send -f mail_send.sql
3. 备份整个表结构:pg_dump -U nsc -d nsc -F c -s -f pg_struct.sql
-C 表示创建该数据库本身。
-F c 表示给pg_restore还原的格式格式,默认表示纯文本格式。
-f 指定输出文件名称。
-a 表示只备份表的内容。
-t 指定表名。
-s 表示只备份表结构。
上述对应恢复命令:
pg_restore
1. 恢复整个数据库:pg_restore -U postgres -d postgres -C -F c nsc.sql
2. 恢复一张表内容:pg_restore -U nsc -d nsc -F c -a mail_send.sql
3. 恢复整个表结构:pg_restore -U nsc -d nsc -F c -s pg_struct.sql
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
详解SQL游标的用法
类型: 1.普通游标 只有next操作 2.滚动游标 有多种操作1.普通游标declare @username varchar(20),@userid varc...
[阅读全文]
-
-
-
-
-
-
-
-
-
网友评论