Re: Remove duplicated row in pg_largeobject_metadata

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tobias Meyer <t9m(at)qad(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Remove duplicated row in pg_largeobject_metadata
Date: 2021-09-18 18:28:11
Message-ID: 1492489.1631989691@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tobias Meyer <t9m(at)qad(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tobias Meyer 2021-09-18 19:00:18 Re: Remove duplicated row in pg_largeobject_metadata
Previous Message Tobias Meyer 2021-09-18 17:58:42 Re: Remove duplicated row in pg_largeobject_metadata