postgresql导入sql脚本

来源:互联网 发布:淘宝店账号 编辑:程序博客网 时间:2024/06/05 17:20
首先进入到postgresql的bin安装目录下


比如D:\software\postgresql\bin


把xx.sql文件放到这个目录下


打开cmd命令窗口


跳转到postgresql的bin目录


cd /d D:\software\postgresql\bin
然后输入下面的命令, username是数据库访问的用户名或者说是角色名比如postgres, dbname 就是数据库的名字,最好是先把这个数据库建好


psql  -U username -W -d dbname -f xx.sql
0 0