pg数据库的导入导出功能


使用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 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM