Hi, Am Dienstag, dem 10.05.2022 um 10:13 +0100 schrieb Simon Riggs: > A minor issue, and patch. > > REINDEX DATABASE currently requires you to write REINDEX DATABASE > dbname, which makes this a little less usable than we might like. > > REINDEX on the catalog can cause deadlocks, which also makes REINDEX > DATABASE not much use in practice, and is the reason there is no test > for REINDEX DATABASE. Another reason why it is a little less usable > than we might like. > > Seems we should do something about these historic issues in the name > of product usability. >
Wow, i just recently had a look into that code and talked with my colleagues on how the current behavior annoyed me last week....and there you are! This community rocks ;) > Attached patch allows new syntax for REINDEX DATABASE, without > needing > to specify dbname. That version of the command skips catalog tables, > as a way of avoiding the known deadlocks. Patch also adds a test. > + /* Unqualified REINDEX DATABASE will skip catalog tables */ + if (objectKind == REINDEX_OBJECT_DATABASE && + objectName == NULL && + IsSystemClass(relid, classtuple)) + continue; Hmm, shouldn't we just print a NOTICE or something like this in addition to this check to tell the user that we are *not* really reindexing all things (and probably give him a hint to use REINDEX SYSTEM to cover them)? Thanks, Bernd