Received: from www.computing.com (dcsi1.aus.tx.bbnow.net [24.219.84.3]) by hub.org (8.10.1/8.10.1) with ESMTP id e6CIJnW92598 for ; Wed, 12 Jul 2000 14:19:49 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by www.computing.com (8.9.3/8.9.3) with ESMTP id NAA53509; Wed, 12 Jul 2000 13:19:33 -0500 (CDT) (envelope-from jmr@computing.com) Date: Wed, 12 Jul 2000 13:19:33 -0500 (CDT) Message-Id: <20000712.131933.71135909.jmr@computing.com> To: karim@thehub.co.uk Cc: pgsql-sql@postgresql.org Subject: Re: importing in sql From: jmr@computing.com In-Reply-To: <396A481C.D8D4E21@thehub.co.uk> References: <396A481C.D8D4E21@thehub.co.uk> X-Mailer: Mew version 1.95b39 on XEmacs 21.1 (20 Minutes to Nikko) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200007/137 karim> The file has the following format karim> karim> field2|field3|field4|field5| karim> karim> Each field is separated by a | (pipe), How do I insert the sequence karim> number before field2? I have like 30 files in this format and I need to karim> import them in one table with each line having unique number. Has karim> anyone come across similar situation? any help would be greatly karim> appreciated. I'd create a new (temporary) table with only these 4 fields, and use COPY to load it. Then, insert the data into the real table from the temp one. Let postgres assign the serial numbers. Something like this: insert into (field2, field3, ...) select * from tmptable; Then you can drop your temp table. Jim Rowan DCSI jmr@computing.com