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

Small annoyance with COPY FROM

From: James David Smith <james(dot)david(dot)smith(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Small annoyance with COPY FROM
Date: 2012-09-28 08:59:47
Message-ID: CAMu32ADFBQPtrVMn0bfEyGD+ebN39Wn+0NbppnkC-ch5bdJKnA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi all,

Not really a big issue, but just something which catches me out
sometimes and I'm not sure if it's just me. When I want to import data
from a CSV file I write the below:

COPY temp_import_table
FROM 'X:/aerasense_12-7-2012.csv' DELIMITERS ',' CSV HEAD

But get the error:

ERROR:  could not open file "X:/aerasense_12-7-2012.csv" for reading:
No such file or directory

However when I move the file to within the PostgreSQL directory of my
C: drive it works fine:

COPY temp_import_table
FROM 'C:/Program Files
(x86)/PostgreSQL/9.0/data/aerasense_12-7-2012.csv' DELIMITERS ',' CSV
HEADER;

Am I doing something wrong, or can PostgreSQL only import data from
it's own directory?

Thanks

James


Responses

pgsql-novice by date

Next:From: Johan NelDate: 2012-09-28 12:56:14
Subject: Re: Small annoyance with COPY FROM
Previous:From: JORGE MALDONADODate: 2012-09-26 21:51:30
Subject: XML and XSD schema generation

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