Re: permissions failure to copy csv data

From: e-letter <inpost(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: permissions failure to copy csv data
Date: 2010-10-10 19:51:58
Message-ID: AANLkTikN-vmDG37Q++XQR35tN7N8cpYYw-HcAbnEO_hU@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 09/10/2010, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> e-letter <inpost(at)gmail(dot)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.

>> su root
>> su postgres
>> psql newdatabasename
>> could not change directory to "/path/to
>
> This would work better with "su -l postgres", so that you don't end
> up with a situation where psql is being started in a directory it
> has no permissions for.
>
Please advise documentation that explains the '-l' command. I tried
'man su' but no terminal response.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Mark Kelly 2010-10-10 21:48:10 Re: Query advice request
Previous Message Mladen Gogala 2010-10-09 23:07:40 Re: Query advice request