Re: Remove duplicated row in pg_largeobject_metadata - Mailing list pgsql-general

From Tom Lane
Subject Re: Remove duplicated row in pg_largeobject_metadata
Date
Msg-id 1492489.1631989691@sss.pgh.pa.us
Whole thread Raw
In response to Re: Remove duplicated row in pg_largeobject_metadata  (Tobias Meyer <t9m@qad.com>)
Responses Re: Remove duplicated row in pg_largeobject_metadata  (Tobias Meyer <t9m@qad.com>)
List pgsql-general
Tobias Meyer <t9m@qad.com> writes:
> so I did
> select ctid as tid,oid,lomowner into temp table temp_pgmeta from
> pg_largeobject_metadata;
> select * from ( select count(tid) as cnt,max(tid), min(tid), oid from
> temp_pgmeta group by oid) x where cnt > 1;

> and that gave me 2951857 rows

Yipes.  Did you verify that the TIDs are all distinct?

A possible theory is that pg_largeobject_metadata_oid_index has been
corrupt for a long time, allowing a lot of duplicate entries to be made.
However, unless pg_largeobject's pg_largeobject_loid_pn_index is *also*
corrupt, you'd think that creation of such duplicates would still be
stopped by that unique index.  There's something mighty odd here.

            regards, tom lane



pgsql-general by date:

Previous
From: Tobias Meyer
Date:
Subject: Re: Remove duplicated row in pg_largeobject_metadata
Next
From: Tobias Meyer
Date:
Subject: Re: Remove duplicated row in pg_largeobject_metadata