Thread: BUG #3707: failure cases in reindex don't always report enough information to diagnose the issue

The following bug has been logged online:

Bug reference:      3707
Logged by:          Rene Gollent
Email address:      rgollent@asteriasgi.com
PostgreSQL version: 8.1.4
Operating system:   Linux (Gentoo)
Description:        failure cases in reindex don't always report enough
information to diagnose the issue
Details:

If you issue a REINDEX DATABASE, which then fails due to db corruption (i.e.
could not create index due to duplicate values), the resulting error message
only specifies:
ERROR:  could not create unique index
DETAIL:  Table contains duplicated values.


without telling you what table actually triggered the error. It *can* be
tracked down by manually looking up the oid of the last table that was
successfully indexed and manually iterating from there, but it'd be nice to
know directly.
"Rene Gollent" <rgollent@asteriasgi.com> writes:
> If you issue a REINDEX DATABASE, which then fails due to db corruption (i.e.
> could not create index due to duplicate values), the resulting error message
> only specifies:
> ERROR:  could not create unique index
> DETAIL:  Table contains duplicated values.

Hmm.  It would be fairly easy to mention the index name here (less so to
mention the table name, but I think you'd really need to know which
index is the problem, anyway).  ISTR that when this error message was
written the index *wasn't* known at the place where the message was
being emitted, but we do have it now ...

            regards, tom lane