pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christopher Sawtell <csawtell@xtra.co.nz>
To: Ed <ed@jetumele.com>
To: pgsql sql <pgsql-sql@postgresql.org>
Subject: Re: \copy...
Date: Wed, 21 Jun 2000 11:37:34 +1200
Message-ID: <00062111431102.28828@berty> (raw)
In-Reply-To: <001001bfd6f8$06761a60$b48c29d1@citenet.net>
References: <001001bfd6f8$06761a60$b48c29d1@citenet.net>

On Fri, 16 Jun 2000, Ed wrote:
> Hi,
> 
> I have a file that look like this :
> 
> firstname|lastname|email@domain.com
> firstname2|lastname2|email2@domain.com
> 
> and a table foo like :
> 
> firstname  varchar(30),
> lastname   varchar(30),
> email    varchar(50)
> 
> and I would like to do a :
> 
> copy tablename from '/home/ed/import.dat';
> 
> But then, everything goes in the first field... what does i'm doing
> wrong?!?!

You are nearly there, use:-

copy tablename from '/home/ed/import.dat' using delimiters '|';

see sql-copy.htm in online doco.

-- 
Sincerely etc.,

 NAME       Christopher Sawtell - iOpen Technologies Ltd.
 CELL PHONE 021 257 4451
 ICQ UIN    45863470
 EMAIL      chris @ iopen . co . nz,  csawtell @ xtra . co . nz
 WWW        http://www.iopen.co.nz
 CNOTES     ftp://ftp.funet.fi/pub/languages/C/tutorials/sawtell_C.tar.gz

 -->> Please refrain from using HTML or WORD attachments in e-mails to me <<--




view thread (8+ messages)  latest in thread

Message-ID: <00062111431102.28828@berty>
Permalink:  ../00062111431102.28828@berty/
Also on:    postgresql.org/message-id/00062111431102.28828@berty

 · 

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: csawtell@xtra.co.nz, ed@jetumele.com
  Subject: Re: \copy...
  In-Reply-To: <00062111431102.28828@berty>

* 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