Re: Confusing error message for REINDEX TABLE CONCURRENTLY

From: Ashwin Agrawal <aagrawal(at)pivotal(dot)io>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Confusing error message for REINDEX TABLE CONCURRENTLY
Date: 2019-06-03 23:53:48
Message-ID: CALfoeiuy52wPygK+dxDcuko7yd1+-a9h7CQt_gDYV25fVSiROg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 28, 2019 at 12:05 PM David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
wrote:

> On Tue, 28 May 2019 at 01:23, Ashwin Agrawal <aagrawal(at)pivotal(dot)io> wrote:
> > I think we will need to separate out the NOTICE message for concurrent
> and regular case.
> >
> > For example this doesn't sound correct
> > WARNING: cannot reindex exclusion constraint index
> "public.circles_c_excl" concurrently, skipping
> > NOTICE: table "circles" has no indexes to reindex
> >
> > As no indexes can't be reindexed *concurrently* but there are still
> indexes which can be reindexed, invalid indexes I think fall in same
> category.
>
> Swap "can't" for "can" and, yeah. I think it would be good to make the
> error messages differ for these two cases. This would serve as a hint
> to the user that they might have better luck trying without the
> "concurrently" option.
>

Please check if the attached patch addresses and satisfies all the points
discussed so far in this thread.

Was thinking of adding explicit errhint for concurrent case NOTICE to
convey, either the table has no indexes or can only be reindexed without
CONCURRENTLY. But thought may be its obvious but feel free to add if would
be helpful.

Attachment Content-Type Size
v2-0001-Avoid-confusing-error-message-for-REINDEX.patch text/x-patch 5.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-06-04 00:18:21 Re: Pinned files at Windows
Previous Message Tom Lane 2019-06-03 23:33:35 Re: WITH NOT MATERIALIZED and DML CTEs