【发布时间】:2020-05-06 12:06:20
【问题描述】:
当尝试使用 psql 运行 SQL 脚本时,出现权限被拒绝错误。
接下来的步骤 -
- 打开了正常的 Bash 交互式 shell
- 运行如下命令
sudo -u postgres -s /bin/bash
- 尝试运行以下 pgsql - 我提供了对 pega 文件夹的读写访问权限;将 pgsql 文件移动到 postgres 库还需要做什么。
/Library/PostgreSQL/12/bin/psql -U dbusername dbpassword </Users/rr/Documents/pega/pega8db.pgsql
出现以下错误
bash: /Users/rr/Documents/pega/pega8db.pgsql: Permission denied
Ps -ef 的结果
502 129 1 0 上午 8:07 ?? 0:00.09 /Library/PostgreSQL/12/bin/postmaster -D/Library/PostgreSQL/12/data
502 281 129 0 上午 8:07 ?? 0:00.00 postgres:记录器
502 283 129 0 上午 8:07 ?? 0:00.01 postgres:检查指针
502 284 129 0 上午 8:07 ?? 0:00.04 postgres:后台编写器
502 285 129 0 上午 8:07 ?? 0:00.02 postgres: walwriter
502 286 129 0 上午 8:07 ?? 0:00.04 postgres:自动真空启动器
502 287 129 0 上午 8:07 ?? 0:00.18 postgres:统计收集器
502 288 129 0 上午 8:07 ?? 0:00.00 postgres:逻辑复制启动器
501 942 1 0 上午 8 点 29 分 ?? 0:11.47 /Library/PostgreSQL/12/pgAdmin 4.app/Contents/MacOS/pgAdmin4
502 947 129 0 8:29 ?? 0:00.02 postgres: postgres postgres ::1(49607) 空闲
502 949 129 0 上午 8:29 ?? 0:00.04 postgres: postgres pega ::1(49623) 空闲
501 957 826 0 8:30 AM ttys000 0:00.00 grep -i postgres
【问题讨论】:
标签: postgresql psql