pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adam Lang <aalang@rutgersinsurance.com>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: copy from
Date: Tue, 15 Aug 2000 08:29:23 -0400
Message-ID: <000c01c006b4$71fd9ce0$330a0a0a@Adam> (raw)
References: <Pine.BSF.4.10.10008141417040.82339-100000@megazone23.bigpanda.com>

I get it.  I upload to the temp table, then for the select/insert I just do
the nextval(seq_id) for the primary key field, correct?

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
----- Original Message -----
From: "Stephan Szabo" <sszabo@megazone23.bigpanda.com>
To: "Adam Lang" <aalang@rutgersinsurance.com>
Cc: <pgsql-sql@postgresql.org>
Sent: Monday, August 14, 2000 5:17 PM
Subject: Re: [SQL] copy from


>
> One way would be to copy the data into a temporary table that doesn't
> have the id field, and then
> insert into table (fields) select * from temptable;
>
> Stephan Szabo
> sszabo@bigpanda.com
>
> On Mon, 14 Aug 2000, Adam Lang wrote:
>
> > I need additional help involving the copy from command
> >
> > I have a database with several fields: id, name, address, zip
> >
> > id is the primary key and I use nextval to get a value.
> >
> > The file I want to upload is in comma separated value, that does not
have a
> > primry key (or an id) field.
> >
> > How would I use copy from and assign the correct id number?
> >
> > Adam Lang
> > Systems Engineer
> > Rutgers Casualty Insurance Company
> >




view thread (7+ messages)  latest in thread

Message-ID: <000c01c006b4$71fd9ce0$330a0a0a@Adam>
Permalink:  ../000c01c006b4$71fd9ce0$330a0a0a@Adam/
Also on:    postgresql.org/message-id/000c01c006b4$71fd9ce0$330a0a0a@Adam

 · 

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: aalang@rutgersinsurance.com, sszabo@megazone23.bigpanda.com
  Subject: Re: copy from
  In-Reply-To: <000c01c006b4$71fd9ce0$330a0a0a@Adam>
  References: <Pine.BSF.4.10.10008141417040.82339-100000@megazone23.bigpanda.com> <000c01c006b4$71fd9ce0$330a0a0a@Adam>

* 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