pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't reset relhasindex for partitioned tables on ANALYZE
Date: Thu, 01 Jul 2021 16:58:47 +0000
Message-ID: <E1lz01X-0002d3-0W@gemulon.postgresql.org> (raw)

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
------
REL_14_STABLE

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

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(-)



view thread (2+ messages)

Message-ID: <E1lz01X-0002d3-0W@gemulon.postgresql.org>
Permalink:  ../E1lz01X-0002d3-0W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lz01X-0002d3-0W@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Don't reset relhasindex for partitioned tables on ANALYZE
  In-Reply-To: <E1lz01X-0002d3-0W@gemulon.postgresql.org>
  References: <E1lz01X-0002d3-0W@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox