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

Re: Table Merge Successful, Primary Keys Missing

From: <operationsengineer1(at)yahoo(dot)com>
To: operationsengineer1(at)yahoo(dot)com, pgsql-novice(at)postgresql(dot)org
Subject: Re: Table Merge Successful, Primary Keys Missing
Date: 2006-06-26 20:01:34
Message-ID: 20060626200134.86708.qmail@web33311.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
clarification below...

--- operationsengineer1(at)yahoo(dot)com wrote:

> i'm trying to merge two tables together.
> 
> i'm able to do it with...
> 
> select * 
> into t_temp_final
> from t_temp_output
> union
> SELECT * FROM t_product
> ; 
> 
> however, i lost all my primary key values in
> t_temp_final
> 
> i can't create a pkey now b/c i have 1000 null
> values.
> 
> how can i get around this situation?
> 
> tia...

the current t_product table entries have product_id
values.  the temp table doesn't.  so i need to add
product_ids wher where product_id IS NULL.

if i knew how to create a serial field (and control
its values to start at a level greater than the
highest t_product product_id value) in an insert into
temp table, i could create product_ids when i create
the insert into temp table and then merge everything
together - complete with product_ids in place.

is this the best way?  if so, how can i work in a
serial field when doing an insert into?

tia...



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

In response to

Responses

pgsql-novice by date

Next:From: Richard Broersma JrDate: 2006-06-26 20:21:54
Subject: Re: Table Merge Successful, Primary Keys Missing
Previous:From: operationsengineer1Date: 2006-06-26 18:47:23
Subject: Table Merge Successful, Primary Keys Missing

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