Received: from pop1-rme.xtra.co.nz (pop1-rme.xtra.co.nz [203.96.92.5]) by hub.org (8.10.1/8.10.1) with ESMTP id e5KNesM96827 for ; Tue, 20 Jun 2000 19:40:54 -0400 (EDT) Received: from berty ([210.55.151.225]) by pop1-rme.xtra.co.nz (InterMail vM.4.01.02.17 201-229-119) with SMTP id <20000620234045.PMY7407980.pop1-rme.xtra.co.nz@berty>; Wed, 21 Jun 2000 11:40:45 +1200 From: Christopher Sawtell Organization: iOpen Technologies Ldt To: "Ed" , "pgsql sql" Subject: Re: \copy... Date: Wed, 21 Jun 2000 11:37:34 +1200 X-Mailer: KMail [version 1.0.29.1] Content-Type: text/plain References: <001001bfd6f8$06761a60$b48c29d1@citenet.net> In-Reply-To: <001001bfd6f8$06761a60$b48c29d1@citenet.net> MIME-Version: 1.0 Message-Id: <00062111431102.28828@berty> Content-Transfer-Encoding: 8bit X-Archive-Number: 200006/187 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 <<--