pgsql: Fix corner-case bug introduced with HOT: if REINDEX TABLE

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix corner-case bug introduced with HOT: if REINDEX TABLE
Date: 2008-08-10 19:02:46
Message-ID: 20080810190246.BFC0B755315@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
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.

Tags:
----
REL8_3_STABLE

Modified Files:
--------------
pgsql/src/backend/catalog:
index.c (r1.292 -> r1.292.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/index.c?r1=1.292&r2=1.292.2.1)
pgsql/src/backend/utils/cache:
relcache.c (r1.266.2.3 -> r1.266.2.4)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/relcache.c?r1=1.266.2.3&r2=1.266.2.4)

Browse pgsql-committers by date

  From Date Subject
Next Message User Pgunittest 2008-08-10 19:50:53 pgscript - pgScript: Removed pgsLogStmt and column in pgsStmt and
Previous Message Tom Lane 2008-08-10 19:02:33 pgsql: Fix corner-case bug introduced with HOT: if REINDEX TABLE