Re: BUG #15023: problem with pg_statistic

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: ktr(at)goldin-rudahl(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, PG Bug reporting form <noreply(at)postgresql(dot)org>
Subject: Re: BUG #15023: problem with pg_statistic
Date: 2018-01-21 17:10:15
Message-ID: 95b5276d-2461-3312-bce0-670b0d29e3b0@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 01/21/2018 03:59 AM, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference: 15023
> Logged by: kurt rudahl
> Email address: ktr(at)goldin-rudahl(dot)com
> PostgreSQL version: Unsupported/Unknown
> Operating system: linux
> Description:
>
> Problem: cannot reindex pg_statistic
> therefore cannot vacuum
>
> Steps to recreate:
> 1. restart postgresql
> 2. psql thaistocks
>
> \set VERBOSITY verbose
> thaistocks=# reindex table pg_statistic;
> ERROR: 23505: could not create unique index
> DETAIL: Table contains duplicated values.
> LOCATION: comparetup_index, tuplesort.c:2163
>
> thaistocks=# select starelid,staattnum from pg_statistic group by
> starelid,staattnum having count(*) > 1;
> starelid | staattnum
> ----------+-----------
> 10723 | 5
> 10728 | 1
> 1260 | 9
> (3 rows)
>

It's really difficult (read: impossible) to help you unless you tell us
more - for example what PostgreSQL version you're running, how did you
get into this situation (e.g. any crashes recently?).

In any case, this seems like a case of data corruption, possibly due to
a bug (not sure which PostgreSQL version you're using) hardware failure
or misconfiguration (e.g. system not handling fsync correctly).

If that's the case, I'd suspect there are other corrupted tables.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2018-01-22 00:55:17 Re: BUG #15024: I am a beginer and in learning face
Previous Message David G. Johnston 2018-01-21 15:17:55 Re: BUG #15024: I am a beginer and in learning face