Re: Allowing REINDEX to have an optional name

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Bernd Helmle <mailings@oopsware.de>
Cc: Simon Riggs <simon.riggs@enterprisedb.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Date: 2022-05-31T12:09:29Z
Lists: pgsql-hackers
On Tue, May 31, 2022 at 11:04:58AM +0200, Bernd Helmle wrote:
> And we already have a situation where this already happens with REINDEX
> DATABASE: if you use CONCURRENTLY, it skips system catalogs already and
> prints a warning. In both cases there are good technical reasons to
> skip catalog indexes and to change the workflow to use separate
> commands.

The case with CONCURRENTLY is different though: the option will never
work on system catalogs so we have to skip them.  Echoing with others
on this thread, I don't think that we should introduce a different
behavior on what's basically the same grammar.  That's just going to
lead to more confusion.  So REINDEX DATABASE with or without a
database name appended to it should always mean to reindex the
catalogs on top of the existing relations.
--
Michael

Commits

  1. Tweak a bit the new TAP tests of REINDEX DATABASE/SYSTEM

  2. Rework logic and simplify syntax of REINDEX DATABASE/SYSTEM

  3. Add more tests for REINDEX DATABASE/SYSTEM with relfilenode changes