postgresql - 安装 Postgres 自定义类型 - 无法访问文件 "...": Permission denied

标签 postgresql unix file-permissions

使用 postgres11,我正在尝试注册源代码分发中的示例 Complex 类型。

我构建的类型没有任何问题:

git clone https://github.com/postgres/postgres.git
cd postgres/src/tutorial
make

但是当我尝试安装它时,我遇到了权限问题:

~/p/s/tutorial> psql -U postgres -W 
Password: 
psql (11.2 (Debian 11.2-1.pgdg90+1))
Type "help" for help.

postgres=# \c testdata
Password for user postgres: 
You are now connected to database "testdata" as user "postgres".
testdata=# 
testdata=# \i complex.sql
psql:complex.sql:39: NOTICE:  type "complex" is not yet defined
DETAIL:  Creating a shell type definition.
psql:complex.sql:39: ERROR:  could not access file "/home/mnuttall/postgres/src/tutorial/complex": Permission denied
psql:complex.sql:47: ERROR:  type complex does not exist

我不确定权限问题到底是从哪里来的,因为我已经将 src/tutorial 目录中所有内容的权限更改为 777。

有人有想法吗?

最佳答案

系统用户 postgres 似乎无法访问您的主目录。

您需要确保上述目录的权限允许用户postgres 进入该目录(r-x)。所以可能的解决方案是运行:

$ chmod o+rx $HOME

如果这没有帮助,请确保也在路径中的每个其他目录上运行该命令。

关于postgresql - 安装 Postgres 自定义类型 - 无法访问文件 "...": Permission denied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55704696/

相关文章:

postgresql - 无法从 SQLite 切换到 Postgres

sql - 具有 2 个返回值的 SELECT 子查询

linux - Grep 多种模式

d - 检查 File/DirEntry 是否可读

node.js - 模块应该在哪里写入文件?

bash - "rw-"文件模式中的第三个符号是什么意思?

php - 启用 PHP APC 查询缓存

postgresql - 在 PostgreSQL 中更改密码时打开 session 会发生什么情况?

java - 是否有用于管理 UNIX ACL 的 Java 接口(interface)

linux - 尝试理解简单的 Linux 代码