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

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 (view raw or flat)
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/

pgsql-sql by date

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

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