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

Duplicate entries with different primary keys (SERIAL)

From: Kumar S <ps_postgres(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Duplicate entries with different primary keys (SERIAL)
Date: 2004-09-28 02:11:57
Message-ID: 20040928021157.64914.qmail@web51404.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
Dear Group, 
 
I have a large mamoth table with many duplicated rows
except one.  Means, out of 10 columns 8 columns data
is identical and 10th one is different (not for every
row but for ~ 50 K rows 13 times). The 9th column is
the unique data column. 

I parsed out the unique IDs and made it into a table
(seq_ID table , number ~ 186K rows).

Using SELECT DISTINCT I creted a temporary table by
givin g a WHERE clause :
WHERE mamoth.table.seq_id = small.table_seq_id;

I expected to see the unique_IDs padded  with rest of
column data from mamoth table. 

However, even after using DISTINCT method I get
duplicated entries with different primary_ids
(generated using SERIAL attribute)

E.g. Please look at the result.
Key_ID  Unique_Seq_id
8793    1000_at
132738  1000_at
8794    1001_at
132739  1001_at
8795    1002_f_at
132740  1002_f_at
8796    1003_s_at
132741  1003_s_at
8797    1004_at
132742  1004_at
8798    1005_at


I made this mamoth table from 13 huge files into
mamoth table by COPY command.

A cursorial check shows me that the data from two
tables is giving raise to duplicated entries. The rest
columns data is identical (to say that they differ
even in spelling mistakes).

Can any one please, please help me. I am stuck with my
project :-(

Thank you very much. 

Kumar

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

In response to

pgsql-novice by date

Next:From: Michael FuhrDate: 2004-09-28 02:53:45
Subject: Re: NOTICE: adding missing FROM-clause entry for table
Previous:From: Kumar SDate: 2004-09-28 01:51:14
Subject: NOTICE: adding missing FROM-clause entry for table

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