pgsql: Don't reset relhasindex for partitioned tables on ANALYZE - Mailing list pgsql-committers

From Alvaro Herrera
Subject pgsql: Don't reset relhasindex for partitioned tables on ANALYZE
Date
Msg-id E1lz01W-0002d2-Vm@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Don't reset relhasindex for partitioned tables on ANALYZE

Commit 0e69f705cc1a introduced code to analyze partitioned table;
however, that code fails to preserve pg_class.relhasindex correctly.
Fix by observing whether any indexes exist rather than accidentally
falling through to assuming none do.

Backpatch to 14.

Author: Alexander Pyhalov <a.pyhalov@postgrespro.ru>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Zhihong Yu <zyu@yugabyte.com>
Discussion: https://postgr.es/m/CALNJ-vS1R3Qoe5t4tbzxrkpBtzRbPq1dDcW4RmA_a+oqweF30w@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d700518d744e53994fdded14b23ebc15b031b0dd

Modified Files
--------------
src/backend/commands/analyze.c       | 32 +++++++++++++++++++++++---------
src/test/regress/expected/vacuum.out | 22 ++++++++++++++++++++++
src/test/regress/sql/vacuum.sql      | 16 ++++++++++++++++
3 files changed, 61 insertions(+), 9 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Improve build-time check that libpq doesn't call exit().
Next
From: Alvaro Herrera
Date:
Subject: pgsql: Don't reset relhasindex for partitioned tables on ANALYZE