首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

对postgresql的命令行操作,导入导入SQL资料,以及生成INSERT语句

2012-09-03 
对postgresql的命令行操作,导入导入SQL文件,以及生成INSERT语句xxx\\PostgreSQL\9.0\bin然后,使用dos窗口

对postgresql的命令行操作,导入导入SQL文件,以及生成INSERT语句

xxx\\PostgreSQL\9.0\bin

然后,使用dos窗口
进入这个位置

导入

导入schema 到 新instance中 (新instance名字叫pis2)
psql -d pis2 -h 192.168.16.179 -p 5432 -U postgres -f ../data/output.sql
[2011-3-28 14:04:40] 张义家: 根据自己的postgre 来导入这个库

导出

psql -d pis2 -h 192.168.16.179 -p 5432 -U postgres -f ../data/output.sql
这里 ,最后的xxx.sql
?是你要导入的数据库文件

导出INSERT语句

首先要定位到这里
D:\Program Files\PostgreSQL\9.0\bin
然后执行该命令
pg_dump?? -h 192.168.16.179 -p 5432? -U postgres? --column-inserts -t pisdb.t_p_mp_rpt? -f? ../data/output.sql? pis2

pis为数据库服务名,pisdb为schema名

热点排行