On Tue, 28 May 2019 at 01:23, Ashwin Agrawal <aagrawal@pivotal.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.