Re: COPY command and required file permissions

Поиск
Список
Период
Сортировка
От Harold A. Giménez Ch.
Тема Re: COPY command and required file permissions
Дата
Msg-id c807ef1a0806120755s56423351x6f59fd44846bb42f@mail.gmail.com
обсуждение исходный текст
Ответ на Re: COPY command and required file permissions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Thanks for the info. SELinux was the guilty party...<br /><br /><div class="gmail_quote">On Thu, Jun 12, 2008 at 10:48
AM,Tom Lane <<a href="mailto:tgl@sss.pgh.pa.us">tgl@sss.pgh.pa.us</a>> wrote:<br /><blockquote
class="gmail_quote"style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
1ex;"><divclass="Ih2E3d">"Harold A. Giménez Ch." <<a
href="mailto:harold.gimenez@gmail.com">harold.gimenez@gmail.com</a>>writes:<br /> > In migrating an application
fromsql server to Postgres, I created a ruby<br /> > script that extracts csv files from sql server (from a windows
box),then<br /> > SCPs them into a directory (/home/ruby_process) on the server running<br /> > Postgres (a
Fedoracore 8) and finally runs the Postgres COPY command for<br /> > each of the csv files.<br /><br /> > When
thescript runs the COPY commnand, I get the following error (for the<br /> > genders table):<br /><br /> > ERROR
  C42501  M could not open file "/home/ruby_process/genders.csv" for<br /> > reading: Permission denied     Fcopy.c
L1694  RCopyFrom (RuntimeError)<br /><br /></div>If you have the directory and file permissions straight, then my
guess<br/> is that you have SELinux turned on and it's disallowing the postgres<br /> daemon from accessing anything
"outof the ordinary".  The best fix<br /> is probably to adjust the security labeling on your transfer directory.<br />
Ican't give you a cookbook recipe for that, but something along the<br /> line of<br /><br /> /usr/bin/chcon -u
system_u-r object_r -t postgresql_db_t /home/ruby_process<br /><br /> might do it.  I'm not sure if you'd need to fool
withthe permissions on<br /> /home as well.<br /><br /> The easiest fix is to disable SELinux, but I wouldn't recommend
that<br/> unless the machine is entirely isolated from the internet.<br /><br />                        regards, tom
lane<br/></blockquote></div><br /> 

В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: COPY command and required file permissions
Следующее
От: Steve Midgley
Дата:
Сообщение: Re: Tsearch