Skip site navigation (1) Skip section navigation (2)

BUG #2904: COPY FROM -> permisson denied

From: "Izsak Rudolf" <rudolf_izsak(at)yahoo(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2904: COPY FROM -> permisson denied
Date: 2007-01-17 23:39:20
Message-ID: (view raw or flat)
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2904
Logged by:          Izsak Rudolf
Email address:      rudolf_izsak(at)yahoo(dot)de
PostgreSQL version: 8.1.6
Operating system:   Fedora Core 6
Description:        COPY FROM -> permisson denied

I wanted to COPY the content of the sample data file /home/csakmost.txt to
my data table t_crdc1 using the following command:

exp03038=# COPY t_crdc1 FROM '/home/csakmost.txt' WITH DELIMITER ' ' NULL

But I have got the error message:

ERROR:  could not open file "/home/csakmost.txt" for reading: Hozzfrs

The letter two words "Hozzfrs megtagadva" stay for "access denied" in

The same procedure worked fine under my system RedHat 9 and PostgreSQL 7.3

I have found some material to similar issues on the web, but all of them
could be solved by changing the permissions of the data file.
I have set the permissons of the file "/home/csakmost.txt" also, so that it
can be read by any users (both of the file and the directory). Also if I try
to read the file as user postgres, it works:
[root(at)yifter ~]# su postgres
bash-3.1$ cat /home/csakmost.txt
4053 1 4 2007-1-17 NULL NULL

Also, it works if I use the command \copy instead of COPY.

I first thought that the owner of the SQL server is an other user than
postgres. But according to the permisson tables of the "/home" and of the
"/home/csakmost.txt", they can be read by all users:
drwxr-xr-x 5 root root 4096 jan 17 23.37 home
-rw-r--r-- 1 root root   29 jan 17 23.52 csakmost.txt

I think, it is a bug, but if it is a feature, I'm sory for that, and I would
be very grateful if You could help me in that case.

Sincerely Yours,

Rudolf Izsak
ELTE, Hungary


pgsql-bugs by date

Next:From: Adriaan van OsDate: 2007-01-18 09:02:12
Subject: BUG #2905: min and max return incorrect text type
Previous:From: Bruce MomjianDate: 2007-01-17 15:58:47
Subject: Re: BUG #2903: can not find bonjour instance

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group