pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: T E Schmitz <mailreg@numerixtechnology.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: import CSV file
Date: Tue, 13 Mar 2007 18:27:33 -0400
Message-ID: <20070313222733.GE3285@alvh.no-ip.org> (raw)
In-Reply-To: <45F70BC9.801@numerixtechnology.de>
References: <45F70BC9.801@numerixtechnology.de>

T E Schmitz wrote:
> I am trying to batch-load a tab-separated CSV file:
> 
> psql -h lolek  -U tes -d stockmarket -c "copy history from 
> '/tmp/FTSE.csv' CSV";
> 
> ERROR:  could not open file "/tmp/FTSE.csv" for reading: No such file or 
> directory
> 
> The file exists. Do I need to escape the quotes?

Is the server on the same machine that's running psql?  If not, then
this fails because it tries to open the file server-side.  The suggested
workaround is to use psql's \copy.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



view thread (11+ messages)  latest in thread

Message-ID: <20070313222733.GE3285@alvh.no-ip.org>
Permalink:  ../20070313222733.GE3285@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20070313222733.GE3285@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: alvherre@commandprompt.com, mailreg@numerixtechnology.de
  Subject: Re: import CSV file
  In-Reply-To: <20070313222733.GE3285@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox