Re: permissions failure to copy csv data - Mailing list pgsql-novice

From e-letter
Subject Re: permissions failure to copy csv data
Date
Msg-id AANLkTin3=-iGkQ2yUEERP8Rn4EJBUZik2KgBO40kDBFs@mail.gmail.com
Whole thread Raw
In response to Re: permissions failure to copy csv data  (Michael Wood <esiotrot@gmail.com>)
List pgsql-novice
On 10/10/2010, Michael Wood <esiotrot@gmail.com> wrote:
> On 10 October 2010 21:51, e-letter <inpost@gmail.com> wrote:
>> On 09/10/2010, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> e-letter <inpost@gmail.com> writes:
>>>> The following command was entered from normal user account where csv
>>>> files
>>>> are:
>>>
>>>> COPY newdatabasenametable FROM '/path/to/file.csv' WITH CSV;
>>>> ERROR:  could not open file "/path/to/file.csv" for reading: Permission
>>>> denied
>>>
>>> The postgres account either doesn't have permission to read that file,
>>> or doesn't have permission to search one of the directories in the path.
>>>
>> Using the command:
>>
>> ls -ao file.csv
>>
>> showed:
>>
>> -rwxr-xr-x
>>
>> This suggests to me that 'others' have permission to search the
>> directory for the file.
>
> No.  That means that if other users have access to the directory, then
> they will be able to read (and execute) the file.
>
> Try running ls -ld on all the directories leading up to that directory.
>
> e.g. if the file is in /path/to/dir/file.csv then run:
>
> ls -ld /
> ls -ld /path
> ls -ld /path/to
> ls -ld /path/to/dir
>
> All of them should have at least an x bit for "other".
>
I used the command:

chmod 755 /path/to

This solved the problem, thank you.

pgsql-novice by date:

Previous
From: Michael Wood
Date:
Subject: Re: permissions failure to copy csv data
Next
From: Lukasz Brodziak
Date:
Subject: Re: Select statement problem