Re: \copy...

From: Christopher Sawtell <csawtell(at)xtra(dot)co(dot)nz>
To: "Ed" <ed(at)jetumele(dot)com>, "pgsql sql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: \copy...
Date: 2000-06-20 23:37:34
Message-ID: 00062111431102.28828@berty
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, 16 Jun 2000, Ed wrote:
> Hi,
>
> I have a file that look like this :
>
> firstname|lastname|email(at)domain(dot)com
> firstname2|lastname2|email2(at)domain(dot)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 <<--

In response to

  • \copy... at 2000-06-15 18:32:13 from Ed

Browse pgsql-sql by date

  From Date Subject
Next Message Ryan Kirkpatrick 2000-06-21 02:36:53 Sequences do not obey transactions...
Previous Message Ed Loehr 2000-06-20 20:05:34 Re: Type conversion