Re: copy from

From: "Adam Lang" <aalang(at)rutgersinsurance(dot)com>
To: "Stephan Szabo" <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: copy from
Date: 2000-08-15 12:29:23
Message-ID: 000c01c006b4$71fd9ce0$330a0a0a@Adam
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)megazone23(dot)bigpanda(dot)com>
To: "Adam Lang" <aalang(at)rutgersinsurance(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)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(at)bigpanda(dot)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
> >

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jesus Aneiros 2000-08-15 13:04:40 Re: data integrity
Previous Message DalTech - CTE 2000-08-15 12:12:58 Re: Functions with Null Arguments?