【发布时间】:2021-08-18 12:39:06
【问题描述】:
问题
尝试在 psql shell 中运行 sql 文件时...
给出“没有这样的文件或目录”错误!
$ ls
config.sql config.yaml
$ sudo -i -u postgres psql
postgres=# \i config.sql
config.sql: No such file or directory
感谢您的回复!
快速解决方案:
-i => 进入用户的主目录!
结果./config.sql地址不正确!
随便用
$ psql -U <user_name>
postgres=# \i config.sql
【问题讨论】:
-
你在运行
sudo -i时切换了当前目录 -
@a_horse_with_no_name 问题解决了!谢谢
标签: postgresql psql