Thanks for the info. SELinux was the guilty party...
On Thu, Jun 12, 2008 at 10:48 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"Harold A. Giménez Ch." <harold.gimenez@gmail.com> writes: > In migrating an application from sql server to Postgres, I created a ruby > script that extracts csv files from sql server (from a windows box), then > SCPs them into a directory (/home/ruby_process) on the server running > Postgres (a Fedora core 8) and finally runs the Postgres COPY command for > each of the csv files.
> When the script runs the COPY commnand, I get the following error (for the > genders table):
> ERROR C42501 M could not open file "/home/ruby_process/genders.csv" for > reading: Permission denied Fcopy.c L1694 RCopyFrom (RuntimeError)
If you have the directory and file permissions straight, then my guess is that you have SELinux turned on and it's disallowing the postgres daemon from accessing anything "out of the ordinary". The best fix is probably to adjust the security labeling on your transfer directory. I can't give you a cookbook recipe for that, but something along the line of