pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: ktr@goldin-rudahl.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form <noreply@postgresql.org>
Subject: Re: BUG #15023: problem with pg_statistic
Date: Sun, 21 Jan 2018 18:10:15 +0100
Message-ID: <95b5276d-2461-3312-bce0-670b0d29e3b0@2ndquadrant.com> (raw)
In-Reply-To: <20180121025924.3633.29967@wrigleys.postgresql.org>
References: <20180121025924.3633.29967@wrigleys.postgresql.org>



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@goldin-rudahl.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




view thread (3+ messages)  latest in thread

Message-ID: <95b5276d-2461-3312-bce0-670b0d29e3b0@2ndquadrant.com>
Permalink:  ../95b5276d-2461-3312-bce0-670b0d29e3b0@2ndquadrant.com/
Also on:    postgresql.org/message-id/95b5276d-2461-3312-bce0-670b0d29e3b0@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, noreply@postgresql.org
  Subject: Re: BUG #15023: problem with pg_statistic
  In-Reply-To: <95b5276d-2461-3312-bce0-670b0d29e3b0@2ndquadrant.com>
  References: <20180121025924.3633.29967@wrigleys.postgresql.org> <95b5276d-2461-3312-bce0-670b0d29e3b0@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox