简体   繁体   English

安装 Postgres 自定义类型 - 无法访问文件“...”:权限被拒绝

[英]Installing Postgres custom type - could not access file "...": Permission denied

Using postgres11, I'm trying to register the example Complex type that comes in the source distribution.使用 postgres11,我正在尝试注册源分发中的示例Complex类型。

I've built the type without any problems:我构建的类型没有任何问题:

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

But when I try to install it, I run into a permission problem:但是当我尝试安装它时,我遇到了权限问题:

~/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

I'm not sure where exactly the permission problem is coming from, as I've changed the permissions for everything in the src/tutorial directory to 777.我不确定权限问题究竟来自哪里,因为我已将 src/tutorial 目录中所有内容的权限更改为 777。

Anyone have an idea?有人有想法吗?

It looks like your home directory is not accessible to system user postgres .系统用户postgres似乎无法访问您的主目录。

You need to make sure that the permissions of the directories above allow user postgres to enter the directory ( rx ).您需要确保上述目录的权限允许用户postgres进入目录 ( rx )。 So possible solution would be to run:所以可能的解决方案是运行:

$ chmod o+rx $HOME

If this doesn't help make sure to run the command on every other directory in the path as well.如果这没有帮助,请确保也在路径中的每个其他目录上运行该命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 铛:错误:无法删除文件:安装Postgres时拒绝权限 - clang: error: unable to remove file: Permission denied when installing Postgres Postgres FATAL:无法打开日志文件权限被拒绝 - Postgres FATAL: could not open log file permission denied Postgres 错误:无法找到全局文件结尾/1262:权限被拒绝 - Postgres ERROR: could not seek to end of file global/1262: Permission denied postgres 无法统计文件<basexxxx/xxxx>没有权限 - postgres could not stat file <basexxxx/xxxx> Permission denied Postgres 错误:无法打开文件进行读取:权限被拒绝 - Postgres ERROR: could not open file for reading: Permission denied Heroku postgres 填充文件权限被拒绝 - Heroku postgres populate file permission denied 致命:无法访问私钥文件“ /etc/ssl/private/ssl-cert-snakeoil.key”:权限被拒绝 - FATAL: could not access private key file “/etc/ssl/private/ssl-cert-snakeoil.key”: Permission denied postgres中的权限被拒绝 - Permission denied in postgres 致命:无法访问私钥文件“/etc/ssl/private/ssl-cert-snakeoil.key”:权限被拒绝 - FATAL: could not access private key file “/etc/ssl/private/ssl-cert-snakeoil.key”: Permission denied 由于锁定文件的权限被拒绝,无法启动 Postgres 服务器 - Unable to start Postgres Server because of permission denied on lock file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM