Fix corner-case bug introduced with HOT: if REINDEX TABLE pg_class (or a
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 10 Aug 2008 19:02:46 +0000 (19:02 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 10 Aug 2008 19:02:46 +0000 (19:02 +0000)
commitc5d1fab8a144d8cb8a6dae1deca8bbb36fd056e7
tree5175b50f0de9df0cbffbef5f72b8b017e6624127
parent4b2b1464bb30cb093a8c3064630dfb65914073c0
Fix corner-case bug introduced with HOT: if REINDEX TABLE pg_class (or a
REINDEX DATABASE including same) is done before a session has done any other
update on pg_class, the pg_class relcache entry was left with an incorrect
setting of rd_indexattr, because the indexed-attributes set would be first
demanded at a time when we'd forced a partial list of indexes into the
pg_class entry, and it would remain cached after that.  This could result
in incorrect decisions about HOT-update safety later in the same session.
In practice, since only pg_class_relname_nsp_index would be missed out,
only ALTER TABLE RENAME and ALTER TABLE SET SCHEMA could trigger a problem.
Per report and test case from Ondrej Jirman.
src/backend/catalog/index.c
src/backend/utils/cache/relcache.c