postgresql - 安装 Postgres 自定义类型 - 无法访问文件“...”:权限被拒绝
问题描述
使用 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
如果这没有帮助,请确保也在路径中的每个其他目录上运行该命令。
推荐阅读
- node.js - 获取邮件列表和活动状态
- sql - 连接具有不同名称的两列
- python - 如何将 netCDF4 文件转换为 geoTiff
- python - 如何将熊猫时间戳更改为 python 日期时间对象?
- android - 如何在 Android Pie 上运行 Apache-Mina SSHD-Server (2.2.0)?
- java - 有没有一种简单的方法可以使用 java 的 Graphics2D 对象逐个字符地淡入字符串字符?
- c# - C# & MongoDb 2.0 - NearSphere 问题
- javascript - Mathjax 库有问题,库没有将输入转换为漂亮的表达式
- c# - Container.Resolve 有什么区别
() 和新视图()? - php - 将 srcset 添加到自动生成的 PHP 库中