importing in sql - Mailing list pgsql-sql

From Abdul Karim
Subject importing in sql
Date
Msg-id 396A481C.D8D4E21@thehub.co.uk
Whole thread Raw
Responses Re: importing in sql  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
Re: importing in sql  (jmr@computing.com)
List pgsql-sql
Hi, I am trying to import loads of data into postgres, I am  having
trouble with a field which is a sequence. I know how to import data
using a delimiter with the copy command. But I need to know how I
increase the sequence on each line of import.

My Table has the following format.

field1    serial primary key,
field2    char (50),
field3    char(50),
field4    int,
field5    date

The file has the following format

field2|field3|field4|field5|

Each field is separated by a | (pipe), How do I insert the sequence
number before field2? I have like 30 files in this format and I need to
import them in one table with each line having unique number.  Has
anyone come across similar situation? any help would be greatly
appreciated.

Please let me know if you need more info.

Thanks in advance.

--
Abdul Karim

The Hub Communications Company Ltd.
The Farmhouse
Syon Park
Middlesex   TW8 8JF

T: 020 8560 9222 (ext 243)
F: 020 8560 9333
Email: mailto:Karim@thehub.co.uk
URL: http://www.thehub.co.uk




pgsql-sql by date:

Previous
From: Gary Stainburn
Date:
Subject: join if there, blank if not
Next
From: "sandis"
Date:
Subject: Re: date comparision ???