Re: running ANALYZE results in => duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index"

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: krah(dot)tm(at)gmail(dot)com, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: running ANALYZE results in => duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index"
Date: 2023-09-06 10:04:50
Message-ID: 267004756.331292.1693994690228@office.mailbox.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/09/2023 09:46 CEST Torsten Krah <krah(dot)tm(at)gmail(dot)com> wrote:

> I am running that one (official docker image)
>
> PostgreSQL 13.11 (Debian 13.11-1.pgdg110+1) on x86_64-pc-linux-gnu,
> compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit

Have you also tried with 13.12?

> and one of my nightly jobs reported that error yesterday when running
> an "ANALYZE":
>
> FEHLER: doppelter Schlüsselwert verletzt Unique-Constraint »pg_statistic_relid_att_inh_index«
> Detail: Schlüssel »(starelid, staattnum, stainherit)=(2609, 4, f)« existiert bereits.
>
> which should translate to something like:
>
> ERROR: duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index"
> > DETAIL: Key (starelid, staattnum, stainherit)=(2609, 4, f) already exists.
>
> Anyone an idea what's wrong?
>
> Maybe (not?) related but sometimes the analyze does fail with:
>
> ERROR: attempted to delete invisible tuple
>
>
> Both errors are only happening here and there - so I don't have a
> reproducer, but still I am curious what is wrong here with me running
> an "ANALYZE" after my data import.

Does the unique constraint violation always occur for the same row? OID 2609
is pg_description.

--
Erik

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Torsten Krah 2023-09-06 10:31:02 Re: running ANALYZE results in => duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index"
Previous Message Laurenz Albe 2023-09-06 09:56:15 Re: running ANALYZE results in => duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index"