Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > COPY command an...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 3526 of 3799
Post > Topic >>

COPY command and required file permissions

by harold.gimenez@[EMAIL PROTECTED] ("=?ISO-8859-1?Q?Harold_A._Gim=E9nez_Ch Jun 12, 2008 at 09:31 AM

------=_Part_24408_17096778.1213277505537
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi all,
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)

My question is, what are the set of permissions required to perform a
postgres copy?

I've set the permissions on the directory so that the postgres group owns
the directory and has read and execute permissions, as follows:
drwxrwxr-x 3 ruby_process postgres

I have also tried moving the files to /tmp and performing the copy from
there, unsuccesfuly.

Any ideas would be appreciated. Thanks,
-Harold

------=_Part_24408_17096778.1213277505537
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi all,<br>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. <br>
<br>When the script runs the COPY commnand, I get the following error (for
the genders table):<br><br>ERROR&nbsp;&nbsp;&nbsp; C42501&nbsp; M could not
open file &quot;/home/ruby_process/genders.csv&quot; for reading:
Permission denied&nbsp;&nbsp;&nbsp;&nbsp; Fcopy.c L1694&nbsp;&nbsp;
RCopyFrom (RuntimeError)<br>
<br>My question is, what are the set of permissions required to perform a
postgres copy? <br><br>I&#39;ve set the permissions on the directory so
that the postgres group owns the directory and has read and execute
permissions, as follows:<br>
drwxrwxr-x 3 ruby_process postgres<br><br>I have also tried moving the
files to /tmp and performing the copy from there, unsuccesfuly.<br><br>Any
ideas would be appreciated. Thanks,<br>-Harold<br><br>

------=_Part_24408_17096778.1213277505537--
 




 3 Posts in Topic:
COPY command and required file permissions
harold.gimenez@[EMAIL PRO  2008-06-12 09:31:45 
Re: COPY command and required file permissions
tgl@[EMAIL PROTECTED] (T  2008-06-12 10:48:00 
Re: COPY command and required file permissions
harold.gimenez@[EMAIL PRO  2008-06-12 10:55:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 21:44:45 CST 2008.