Confusing error message for REINDEX TABLE CONCURRENTLY - Mailing list pgsql-hackers

From Ashwin Agrawal
Subject Confusing error message for REINDEX TABLE CONCURRENTLY
Date
Msg-id CALfoeithHvi13p_VyR8kt9o6Pa7Z=Smi6Nfc2anHnQx5Lj8bTQ@mail.gmail.com
Whole thread Raw
Responses Re: Confusing error message for REINDEX TABLE CONCURRENTLY  (David Rowley <david.rowley@2ndquadrant.com>)
List pgsql-hackers

CREATE TABLE circles (c circle, EXCLUDE USING gist (c WITH &&));

REINDEX TABLE CONCURRENTLY circles;
WARNING:  cannot reindex exclusion constraint index "public.circles_c_excl" concurrently, skipping
NOTICE:  table "circles" has no indexes
REINDEX

The message "table has no indexes" is confusing, as warning above it states table has index, just was skipped by reindex.

So, currently for any reason (exclusion or invalid index) reindex table concurrently skips reindex, it reports the table has no index. Looking at the behavior of non-concurrent reindex, it emits the NOTICE only if table really has no indexes (since it has no skip cases).

We need to see what really wish to communicate here, table has no indexes or just that reindex was *not* performed or keep it simple and completely avoid emitting anything. If we skip any indexes we anyways emit WARNING, so that should be sufficient and nothing more needs to be conveyed.

In-case we wish to communicate no reindex was performed, what do we wish to notify for empty tables?

Seems might be just emit the NOTICE "table xxx has no index", if really no index for concurrent and non-concurrent case, make it consistent, less confusing and leave it there. Attaching the patch to just do that. Thoughts?


Attachment

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Suppressing noise in successful check-world runs
Next
From: "Jonah H. Harris"
Date:
Subject: Re: Indexing - comparison of tree structures