首页 > 数据库技术 > 详细

pg数据库的导入导出功能

时间:2020-07-14 17:33:37      阅读:58      评论:0      收藏:0      [点我收藏+]

使用pg_dumo进行导出数据

基于表进行导出:

pg_dump -U postgres -t test1 yy >/root/test1.sql

-U 用户名

-t 表名

yy库名

 

基于库进行导出:

pg_dump -U postgres  -d yy >/root/test1.sql

 

导出时不导出建表语句只导出数据

pg_dump -U postgres -t test1 yy -a >/root/test1.sql

 

恢复:

psql -U postgres -d yy -t test1 </root/test2.sql 

 

pg数据库的导入导出功能

原文:https://www.cnblogs.com/yandh/p/13299141.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!