pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nuchanach Klinjun <nuchk@inet.co.th>
Cc: Stéphane FILLON <fillons@offratel.nc>
Cc: pgsql-sql <pgsql-sql@postgreSQL.org>
Cc: pgsql-hackers <pgsql-hackers@postgreSQL.org>
Cc: pgsql-general <pgsql-general@postgreSQL.org>
Subject: Re: [HACKERS] Permission problem with COPY FROM
Date: Wed, 15 Sep 1999 10:00:02 -0400
Message-ID: <19098.937404002@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.OSF.4.10.9909151118490.1360-100000@johann.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



view thread (4+ messages)  latest in thread

Message-ID: <19098.937404002@sss.pgh.pa.us>
Permalink:  ../19098.937404002@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19098.937404002@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, nuchk@inet.co.th, fillons@offratel.nc, pgsql-hackers@postgreSQL.org, pgsql-general@postgreSQL.org
  Subject: Re: [HACKERS] Permission problem with COPY FROM
  In-Reply-To: <19098.937404002@sss.pgh.pa.us>
  References: <Pine.OSF.4.10.9909151118490.1360-100000@johann.inet.co.th> <19098.937404002@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox