Thread: Permission problem with COPY FROM
Hi,
Each time I try to insert an ascii file with the COPY FROM command, I get the following message:
"ERROR: COPY command, running in backend with effective uid 501 (that's Postgres), could not open file '/usr/local/.../cltclr001' for reading. Error: Permission not allowed (13)."
What rights do I have to put to process the COPY command inside PSQL.
I have try nearly everything, actual rights: uog+rw even on the directory.
What's wrong.
Stephane FILLON
Hi, I've faced that problem too, then I use '\copy' instread of 'copy' because 'copy' command will asked for super user previlege. example ^^^^^^ -> \copy '/your location/your filename' to tablename; Cheers, On Wed, 15 Sep 1999, [iso-8859-1] St�phane FILLON wrote: > Hi, > > Each time I try to insert an ascii file with the COPY FROM command, I get the following message: > > "ERROR: COPY command, running in backend with effective uid 501 (that's Postgres), could not open file '/usr/local/.../cltclr001'for reading. Error: Permission not allowed (13)." > > What rights do I have to put to process the COPY command inside PSQL. > > I have try nearly everything, actual rights: uog+rw even on the directory. > > > What's wrong. > > Stephane FILLON > ----------------------------------------- Nuchanach Klinjun R&D Project. Internet Thailand Email: nuchk@inet.co.th
Nuchanach Klinjun <nuchk@inet.co.th> writes: > I've faced that problem too, then I use '\copy' instread > of 'copy' because 'copy' command will asked for super user previlege. > example > ^^^^^^ -> \copy '/your location/your filename' to tablename; It's not that; the error message Stephane quotes is after the Postgres superuser-privilege check: >> "ERROR: COPY command, running in backend with effective uid 501 >> (that's Postgres), could not open file '/usr/local/.../cltclr001' for >> reading. Error: Permission not allowed (13)." This is a result of the Unix kernel denying read access to the file. It's got to be a matter of not having read rights on the file or not having lookup (x) rights on one of the directories above it. psql's \copy is often a better choice than the regular SQL COPY command, though. It reads or writes the file with the privileges of the user running psql, rather than those of the Postgres server, which is usually a Good Thing. Also, if you are contacting a server on a different machine, \copy works with files in the local filesystem, not the server's filesystem. regards, tom lane
On Wed, Sep 15, 1999 at 03:50:09AM +1100, Stéphane FILLON wrote: ... > > "ERROR: COPY command, running in backend with effective uid 501 > (that's Postgres), could not open file '/usr/local/.../cltclr001' for > reading. Error: Permission not allowed (13)." > The problem does not seem to be with the permissions --- it has been on the list a number of times already. Try using psql's \copy instead. Albert. -- --------------------------------------------------------------------------- Post an / Mail to / Skribu al: Albert Reiner<areiner@tph.tuwien.ac.at> ---------------------------------------------------------------------------