Re: copy import csv problem - Mailing list pgsql-novice

From Andrew McMillan
Subject Re: copy import csv problem
Date
Msg-id 1018740010.19837.406.camel@kant.mcmillan.net.nz
Whole thread Raw
In response to copy import csv problem  (Peter Lowman <itsasecret4@bigpond.com>)
List pgsql-novice
On Sun, 2002-04-14 at 11:12, Peter Lowman wrote:
> Have only just installed RH7.2 and pgsql
>
> I'm trying to import an access csv file have already setup db with
> necessary columns.
>
> COPY wests from '/home/peter/wests.csv' using delimiters ';';
>
> ERROR: COPY command, running in background with effective uid 26, could
> not open file '/home/peter/wests.csv' for reading. Errno = Permission
> denied (13).
>
> I can view the file with editors etc.  I'v tried su postgres, same result.
>
> How can can I get permission?

The COPY command runs within the database server, so it is often running
as a different user (on Debian it runs as 'postgres', not sure on RH) so
that user needs permission to access the file.

psql also has a \copy which is _similar_ but will read the file within
the psql process, and hence as your user, but check the man page because
I think there are some subtle differences.

Regards,
                    Andrew.
--
--------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/        PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201    MOB: +64(21)635-694    OFFICE: +64(4)499-2267
       Are you enrolled at http://schoolreunions.co.nz/ yet?


pgsql-novice by date:

Previous
From: Peter Lowman
Date:
Subject: copy import csv problem
Next
From: April L
Date:
Subject: string functions