copy command

Started by Jim Bryanover 19 years ago3 messagesgeneral
Jump to latest
#1Jim Bryan
gooddayarizona@yahoo.com

Hi! - Fedora Core 5, cannot copy text file into a
table called datetime, yet the permissions seem OK:

copy datetime from '/home/jb/Desktop/DateTimeData.txt'
with csv;

ERROR: could not open file
"/home/jb/Desktop/DateTimeData.txt" for reading:
Permission denied

-rw-rw-r-- 1 jb jb 83 Aug 25 14:30
DateTimeData.txt

Linux log-in is user: jb, su to root for /sbin/service
postgresql start (was installed using default user:
postgres and the servers still use postgres).
This might be more of a linux question, but for some
reason the back-end Postgresql server can't get into
the needed text file -? Ideas appreciated.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#2Bruce Momjian
bruce@momjian.us
In reply to: Jim Bryan (#1)
Re: copy command

Jim Bryan <gooddayarizona@yahoo.com> writes:

"/home/jb/Desktop/DateTimeData.txt" for reading:
Permission denied

-rw-rw-r-- 1 jb jb 83 Aug 25 14:30
DateTimeData.txt

I suspect it doesn't have "x" permission on some parent directory, what does

ls -ld /home /hoome/jb /home/jb/Desktop

print?

--
greg

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: copy command

Gregory Stark <gsstark@mit.edu> writes:

Jim Bryan <gooddayarizona@yahoo.com> writes:

"/home/jb/Desktop/DateTimeData.txt" for reading:
Permission denied

-rw-rw-r-- 1 jb jb 83 Aug 25 14:30
DateTimeData.txt

I suspect it doesn't have "x" permission on some parent directory,

Yeah, user home directories are not normally world-readable in Fedora.
Even if you've made yours readable, the default SELinux policy in FC5
prevents daemons such as the PG postmaster from accessing random parts
of the filesystem.

Consider using psql's \copy instead.

regards, tom lane