原文地址:https://blog.csdn.net/qq_39329616/article/details/94730460
**
1.切换至PostgreSQL安装目录下
cd /usr/local/postgre/pgsql/bin
2.导入sql文件
./psql -d test2 -U postgres -f /usr/local/potgre/db.sql
-d
数据库名-U
数据库用户名-f
sql文件路径
注意这里,原文地址推荐直接使用psql
,但是我垃圾,配置环境变量的时候总报错,在这里记录以下。