Thread: duplicated oid

duplicated oid

From
Carolyn Lu Wong
Date:
i'm using V6.5.

From my understanding, the oid should be unique in all rows of database.
However, I'm getting duplicated data on one particular table, including
the oid is the same! I don't recall trying to restore nor import any
data.

Any idea why?


Re: duplicated oid

From
Carolyn Lu Wong
Date:
anyone knows if duplicated oid is possible?? 

is there a possible way to remove the duplicate row, now that i don't
know which ID to use? any suggestions?

Carolyn Lu Wong wrote:
> 
> i'm using V6.5.
> 
> >From my understanding, the oid should be unique in all rows of database.
> However, I'm getting duplicated data on one particular table, including
> the oid is the same! I don't recall trying to restore nor import any
> data.
> 
> Any idea why?
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org


Re: duplicated oid

From
Stephan Szabo
Date:
On Fri, 7 Sep 2001, Carolyn Lu Wong wrote:

> anyone knows if duplicated oid is possible?? 
> 
> is there a possible way to remove the duplicate row, now that i don't
> know which ID to use? any suggestions?

Hmm, that's wierd.
AFAIK that should only occur in cases like copy with oids and oid wrap
around (but that'd be unlikely to give you the same row twice).  I'd
guess copy with oids or a plain bug would be more likely.

You can probably use ctid to differentiate between the rows for a delete.

(And you should probably look at upgrading :) )



Re: duplicated oid

From
Tom Lane
Date:
Carolyn Lu Wong <carolyn@greatpacific.com.au> writes:
> anyone knows if duplicated oid is possible?? 

Yes, if you don't have a unique index on it and you've generated more
than four billion rows in the database.

> is there a possible way to remove the duplicate row, now that i don't
> know which ID to use? any suggestions?

Use ctid to distinguish the rows.  Note ctid will change if you update
a row, so it's not a permanent identifier either, but it will serve for
deleting a row.
        regards, tom lane