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

Re: Newbie trying to load table with data...

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Newbie trying to load table with data...
Date: 2002-08-13 21:23:29
Message-ID: 1029273809.1353.630.camel@linda (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On Tue, 2002-08-13 at 19:41, Kurt Gunderson wrote:
> Sorry guys, I am new to Postgresql and have exhausted my reading 
> material.  I am trying to load a "k_device" table with records from an 
> pipe-delimited ascii file ("/home/kurt/data/sql.device.d").  In psql, I 
> get the following...

> test1=> \copy "k_device" from "/home/kurt/data/sql.device.d" with 
> delimiters '|'
> \copy: parse error at 'delimiters'
> and...
> test1=> \copy "k_device" from "/home/kurt/data/sql.device.d" using 
> delimiters '|'
> "/home/kurt/data/sql.device.d": No such file or directory
> <\THIRD>
> What am I doing wrong?  Please help.

You're using the wrong kind of quotes.  The filepath must be in single

  \copy k_device from '/home/kurt/data/sql.device.d' using delimiters '|'

Oliver Elphick                                Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK                   
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
     "Watch ye therefore, and pray always, that ye may be 
      accounted worthy to escape all these things that shall
      come to pass, and to stand before the Son of man."    
                               Luke 21:36 

In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2002-08-13 21:35:03
Subject: Re: I need to know password for postgres
Previous:From: Tom LaneDate: 2002-08-13 21:11:29
Subject: Re: Newbie trying to load table with data...

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