Skip site navigation (1) Skip section navigation (2)

Re: Copy Data Question

From: <operationsengineer1(at)yahoo(dot)com>
To: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Copy Data Question
Date: 2006-06-22 21:54:47
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
> > how can i add *only* nonexisting entries to my db
> > tables (iow, if it is one of the 100+ there now, i
> > don't want to mess with it)?
> I will take a stab at the easy question. Out of test
> solutions, this is the one that I know.
> 1. create a temp table using destination table
> schema using the LIKE clause.
> 2. import external data into the temp table.
> 3. select into destinationtable from temptable where
> temptable.primarykey not exists
> ( select destinationtable.primarykey
>    from destination table
> );  

Richard, thanks.  in my case, the primary key isn't
relevant, however, the product_number is (it is
unique).  iiuc, in my case i should use product_number
instead of primarykey.

it makes sense - thanks for the enlightenment.

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

In response to


pgsql-novice by date

Next:From: DataIntellectDate: 2006-06-22 23:20:56
Subject: Re: Copy Data Question
Previous:From: Richard Broersma JrDate: 2006-06-22 21:16:51
Subject: Re: Copy Data Question

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group