Thread: server permissions for sql copy

server permissions for sql copy

From
Andrew Gould
Date:
Good morning,

I'm running PostgreSQL 7.0.2 on Caldera eDesktop 2.4.
when I try to use the SQL COPY command in psql, I get
an error message informing me that the backend could
not open the file for reading.  I think the error
number was 13 - Permission denied.  I changed the
permissions of the directory and file to
world-readable; but I still get the same error
message.

Does anyone have any suggestions as to what I should
try next?

Thanks,

Andrew Gould

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

Re: server permissions for sql copy

From
Tom Lane
Date:
Andrew Gould <andrewgould@yahoo.com> writes:
> I'm running PostgreSQL 7.0.2 on Caldera eDesktop 2.4.
> when I try to use the SQL COPY command in psql, I get
> an error message informing me that the backend could
> not open the file for reading.  I think the error
> number was 13 - Permission denied.  I changed the
> permissions of the directory and file to
> world-readable; but I still get the same error
> message.

What about the directories above the one containing the file?

Also, don't forget that the critical permission for a directory
is execute (= "allow lookup of entries"), not read (= "make a
directory listing").  You probably want permissions rwxr-xr-x
or rwxrwxr-x on directories that need to be publicly readable.

            regards, tom lane

Re: server permissions for sql copy

From
"Joel Burton"
Date:
> I'm running PostgreSQL 7.0.2 on Caldera eDesktop 2.4.
> when I try to use the SQL COPY command in psql, I get
> an error message informing me that the backend could
> not open the file for reading.  I think the error
> number was 13 - Permission denied.  I changed the
> permissions of the directory and file to
> world-readable; but I still get the same error
> message.

Keep in mind it's the *server* process (user postgres), trying to get
to the file, not the psql user (probably you). Is the file in *your*
home directory?

You'll need to chmod a+rx this directory, and all directories above
this directory.

On our server, we've created a directory for pgsql copying and
dumping that is rwx for postgres and our DBAs.

--
Joel Burton, Director of Information Systems -*- jburton@scw.org
Support Center of Washington (www.scw.org)

Re: server permissions for sql copy

From
Andrew Gould
Date:
Yup, that was the problem.  COPY works fine now.

Thanks for yet another lesson.

Andrew Gould

--- Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Andrew Gould <andrewgould@yahoo.com> writes:
> > I'm running PostgreSQL 7.0.2 on Caldera eDesktop
> 2.4.
> > when I try to use the SQL COPY command in psql, I
> get
> > an error message informing me that the backend
> could
> > not open the file for reading.  I think the error
> > number was 13 - Permission denied.  I changed the
> > permissions of the directory and file to
> > world-readable; but I still get the same error
> > message.
>
> What about the directories above the one containing
> the file?
>
> Also, don't forget that the critical permission for
> a directory
> is execute (= "allow lookup of entries"), not read
> (= "make a
> directory listing").  You probably want permissions
> rwxr-xr-x
> or rwxrwxr-x on directories that need to be publicly
> readable.
>
>             regards, tom lane


__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/