简体   繁体   English

Pgadmin 错误:无法打开文件读取:权限被拒绝

[英]Pgadmin ERROR: could not open file reading: Permission denied

I am a newbie for Psql, just wanted to copy the data into psql with codes:我是Psql的新手,只是想用代码将数据复制到psql中:

COPY consumer_complaints
FROM '/users/xxxx/Desktop/ConsumerComplaints.csv';

But, it wouldn't allow me to, as it showed following:但是,它不允许我这样做,如下所示:

ERROR:  could not open file "/users/xxxx/Desktop/ConsumerComplaints.csv" for reading: Permission denied HINT:  COPY FROM instructs the PostgreSQL server process to read a file. You may want a client-side facility such as psql's \copy. SQL state: 42501

I am so desperate at this point I don't know what to do.此刻我很绝望,我不知道该怎么办。

Here is a sample of the data.是数据的示例。

This is the permission of the file: enter image description here这是文件的权限:在此处输入图片描述

update:更新:

03/22/2020: 1. I tried replay copy with \\copy , and it still didnt work. 2020年3月22日:1。我试着重播copy\\copy ,它仍然没有工作。

You should try steps :您应该尝试以下步骤

  1. Right-click on the file右键单击文件
  2. Go to Get info > Sharing and permissions转到获取信息>共享和权限
  3. Click on + button and add PostgreSQL to permission read this file.单击+按钮并将 PostgreSQL 添加到读取此文件的权限。

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

相关问题 流文件打开导致访问拒绝错误 - ACCESS DENIED error from stream file open 如何解决无法识别当前目录:权限被拒绝 - How to resolve could not identify current directory: Permission denied 从文件流中读取时访问被拒绝错误 - Access Denied error while reading from filestream 无法打开物理文件。 操作系统错误 5:“5(拒绝访问。)” - Unable to open the physical file. Operating system error 5: "5(Access is denied.)" (PostgreSQL)错误:无法打开关系 - (PostgreSQL) ERROR: could not open relation 错误-对对象'sysobjects',数据库'mssqlsystemresource',模式'sys'的SELECT权限被拒绝 - Error - The SELECT permission was denied on the object 'sysobjects', database 'mssqlsystemresource', schema 'sys' 错误:使用 Postgres 拒绝序列 city_id_seq 的权限 - ERROR: permission denied for sequence cities_id_seq using Postgres SQL 代码未运行,收到“架构公共权限被拒绝”错误消息 - SQL code not running , getting a "permission denied for schema public" error message 尝试恢复 .dump 文件 postgres 时权限被拒绝 - Permission Denied when trying to restore .dump file postgres 已授予Postgres角色,但因关系错误而拒绝获得权限 - Postgres role granted but getting permission denied for relation error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM