On Mon, Oct 4, 2021 at 2:00 AM Alexander Lakhin <exclus...@gmail.com> wrote: > There is another issue, that maybe should be discussed separately (or > this thread could be renamed to "... on checking specific relations"), > but the solution could be similar to that.
Thanks for the report! I wonder if verify_heapam.c does the right thing with unlogged tables when verification runs on a standby -- a brief glance at the code leaves me with the impression that it's not handled there. Note that verify_nbtree.c initially got it wrong. The issue was fixed by bugfix commit 6754fe65. Before then nbtree verification could throw a nasty low-level smgr error, just because we had an unlogged table in hot standby mode. Note that we deliberately skip indexes when this happens (we don't error out), unlike the temp buffers (actually temp table) case. This seems like the right set of behaviors. We really don't want to have to throw an "invalid object type" style error just because verification runs during recovery. Plus it just seems logical to assume that unlogged indexes/tables don't have storage when we're in hot standby mode, and so must simply have nothing for us to verify. -- Peter Geoghegan