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

Re: Problem with sql COPY command

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Jon Asher <jon(at)vagabond-software(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem with sql COPY command
Date: 2004-08-27 22:50:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general

Am Sa, den 28.08.2004 schrieb Jon Asher um 0:03:
> Hi,
> I'm trying to do a simple import of a comma delimited text file with
> COPY but it's returning an error.  The file has been granted all
> permissions in Linux, so it's not clear to me what the problem is. 
> Version 7.41 is installed... see below for details:
> A comma delimited text file has been placed in a local directory with
> permissions set to allow any user to read or write to it: 
> /root/Desktop/server_transfer/WorldPoints_v2.txt' 
> I'm trying to use the COPY command to import this text file into a
> table from the PSQL command prompt. 
> First, open PSQL with parameters to open the right db:  psql
> my_database -h xxxx -U xxx
> To import this file from the PSQL command line, call the COPY command:
> copy public.world_stopwatch_v2 FROM
> '/root/Desktop/server_transfer/WorldPoints_v2.txt' using delimiters
> ','; 
> COPY fails with this error message: 
> could not open file "/root/Desktop/server_transfer/WorldPoints_v2.txt"
> for reading: Permission denied 
> (Database checked- it contains a table called:
> public.world_stopwatch_v2)

*wild guessing* Is desktop and server the same 
machine? If not, you cannot use the copy command
that way. If you issue a copy command with a path
to a file, the backand on the server has to find
the file. If its on your desktop, this operation
will not succeed.

Either you copy your file to the server in that case
or use copy from stdin with psql.

Tino Wildenhain

In response to

pgsql-general by date

Next:From: Marc G. FournierDate: 2004-08-27 23:15:27
Subject: Re: [OT?] Problems with majordomo :-)
Previous:From: Richard PooleDate: 2004-08-27 22:16:25
Subject: Re: Problem with sql COPY command

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