Re: copy import csv problem

From: Andrew McMillan <andrew(at)catalyst(dot)net(dot)nz>
To: Peter Lowman <itsasecret4(at)bigpond(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: copy import csv problem
Date: 2002-04-13 23:20:10
Message-ID: 1018740010.19837.406.camel@kant.mcmillan.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bartus Levente 2002-04-14 16:57:50 writing to file
Previous Message Peter Lowman 2002-04-13 23:12:42 copy import csv problem