Re: pgstatindex vs. !indisready
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Noah Misch <noah@leadboat.com>
Cc: pgsql-hackers@postgresql.org
Date: 2023-10-01T20:37:25Z
Lists: pgsql-hackers
Noah Misch <noah@leadboat.com> writes: > Running pgstatindex on some !indisready indexes fails with "ERROR: XX001: > could not read block 0 in file". This reproduces it: > ... > Since XX001 = ERRCODE_DATA_CORRUPTED appears in the "can't-happen" class, it's > not a good fit for this scenario. I propose to have pgstatindex fail early on > !indisready indexes. +1 > We could go a step further and also fail on > indisready&&!indisvalid indexes, which are complete enough to accept inserts > but not complete enough to answer queries. I don't see a reason to do that, > but maybe someone else will. Hmm. Seems like the numbers pgstatindex would produce for a not-yet-complete index would be rather irrelevant, even if the case doesn't risk any outright problems. I'd be inclined to be conservative and insist on indisvalid being true too. regards, tom lane
Commits
-
Diagnose !indisvalid in more SQL functions.
- bae063db499f 11.22 landed
- 975ae05537fa 12.17 landed
- 123b0d111511 13.13 landed
- 0a7b183fdc1b 14.10 landed
- e633e9b132ff 15.5 landed
- 1a368dd3ecef 16.1 landed
- 13503eb5905b 17.0 landed