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

Re: COPY command and required file permissions

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: Harold A(dot) Giménez Ch(dot) <harold(dot)gimenez(at)gmail(dot)com>
Cc: "sql pgsql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: COPY command and required file permissions
Date: 2008-06-12 14:28:34
Message-ID: 162867790806120728g1e2ec0e2s5126db773d50c3dd@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-sql
2008/6/12 Harold A. Giménez Ch. <harold(dot)gimenez(at)gmail(dot)com>:
> 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?

user postgres has to have access for read.

regards
Pavel Stehule

>
> 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
>
>

In response to

pgsql-sql by date

Next:From: Tom LaneDate: 2008-06-12 14:48:00
Subject: Re: COPY command and required file permissions
Previous:From: Harold A. Giménez Ch.Date: 2008-06-12 13:31:45
Subject: COPY command and required file permissions

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