pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Abdul Karim <karim@thehub.co.uk>
To: pgsql-sql@postgreSQL.org
Subject: importing in sql
Date: Mon, 10 Jul 2000 17:03:08 -0500
Message-ID: <396A481C.D8D4E21@thehub.co.uk> (raw)

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





view thread (3+ messages)  latest in thread

Message-ID: <396A481C.D8D4E21@thehub.co.uk>
Permalink:  ../396A481C.D8D4E21@thehub.co.uk/
Also on:    postgresql.org/message-id/396A481C.D8D4E21@thehub.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: karim@thehub.co.uk
  Subject: Re: importing in sql
  In-Reply-To: <396A481C.D8D4E21@thehub.co.uk>
  References: <396A481C.D8D4E21@thehub.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox