Add more tests for REINDEX DATABASE/SYSTEM with relfilenode changes
authorMichael Paquier <michael@paquier.xyz>
Tue, 19 Jul 2022 01:51:27 +0000 (10:51 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 19 Jul 2022 01:51:27 +0000 (10:51 +0900)
commit5fb5b6c4c176d873bd8405ec40f7002daf242a36
treeb1fbf3e74f97e9eb5dd8c5897b506edcc4e95925
parent950e64fa46b164df87b5eb7c6e15213ab9880f87
Add more tests for REINDEX DATABASE/SYSTEM with relfilenode changes

Adding such commands in the main regression test suite is not a good
approach performance-wise as it impacts all the objects in the
regression database, so this additional coverage is added in the TAP
tests of reindexdb where we already run a few REINDEX commands with
SYSTEM and DATABASE so there is no runtime difference for the test.
This additional coverage checks which relations are rewritten with
relfilenode changes, as of:
- a toast index in user table.
- a toast index in catalog table.
- a catalog index.
- a user index.

This test suite is something I have implemented for a separate patch
that reworks a bit the way we handle these two REINDEX behaviors, but it
has enough value in itself to be in a separate commit.  This also makes
easier to follow what actually changes once the REINDEX logic is
reworked (currently, DABATASE rewrites both catalog and user tables, and
SYSTEM works only on catalogs).

Discussion: https://postgr.es/m/YtOqA7ldcJQADEE8@paquier.xyz
src/bin/scripts/t/090_reindexdb.pl