Postgresql:postgres命令行导入sql文件

sql文件导入

psql -d jdbc -h localhost -p 5432 -U postgres -f /home/sql/test.sql

#-d 数据库名称
#-h ip地址
#-p 端口号
#-U 用户
#-f sql文件路径

sql文件导出

pg_dump -h localhost -p 5432 -U postgres -f /home/sql/test.sql jdbc

#-h 数据库名称
#-p 端口号
#-U 用户
#-f 保存路径
#jdbc  数据库名称
----------------------------------- 作者:怒吼的萝卜 链接:http://www.cnblogs.com/nhdlb/ -----------------------------------
原文地址:https://www.cnblogs.com/nhdlb/p/14960000.html