我尝试使用以下查询将PGAdmin表(学生)导出到csv:
Copy (Select * From public."Students") To '/Users/dar/Desktop/postgs2sqlserver.csv' With CSV;我得到了以下错误:
ERROR: could not open file "/Users/dar/Desktop/postgs2sqlserver.csv" for writing: Permission denied SQL state: 42501发布于 2015-02-11 05:26:48
当您执行“复制”时,将使用运行PostgreSQL进程的用户postgres的权限创建该文件。
您可以更改该文件的权限,以允许用户对其进行写入,或者选择服务器用户已有权限的目录。
在Linux中,您可以尝试这样更改文件所有者:-
chown user file
chown user directory
chown -R user directory 要授予写入权限,请执行以下操作:
chmod a+w file
chmod -R a+w directoryhttps://stackoverflow.com/questions/28441858
复制相似问题