Re: \copy...

From: Webb Sprague <wsprague100(at)yahoo(dot)com>
To: Ed <ed(at)jetumele(dot)com>, pgsql sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: \copy...
Date: 2000-06-20 16:56:36
Message-ID: 20000620165636.11913.qmail@web805.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Finally--a question I think I can answer!

You need to specify what delimiters you use in your
.dat file; the default for COPY is tab, but you can
change that to | with

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

Hope this works...(oops--I mean 'helps')

--- Ed <ed(at)jetumele(dot)com> 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?!?!
>
> Frdric Boucher
> Ed(at)jetumele(dot)com
> Programmation, Support technique
> Jetumele Communications inc.
>
>

__________________________________________________
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/

Browse pgsql-sql by date

  From Date Subject
Next Message mikeo 2000-06-20 17:09:56 Re: Re: Simple search question
Previous Message Ferruccio Zamuner 2000-06-20 15:19:22 Re: [SQL] Database Transfer