pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor option handling of CLUSTER, REINDEX and VACUUM
Date: Mon, 18 Jan 2021 05:05:54 +0000
Message-ID: <E1l1Mji-0005lg-Re@gemulon.postgresql.org> (raw)

Refactor option handling of CLUSTER, REINDEX and VACUUM

This continues the work done in b5913f6.  All the options of those
commands are changed to use hex values rather than enums to reduce the
risk of compatibility bugs when introducing new options.  Each option
set is moved into a new structure that can be extended with more
non-boolean options (this was already the case of VACUUM).  The code of
REINDEX is restructured so as manual REINDEX commands go through a
single routine from utility.c, like VACUUM, to ease the allocation
handling of option parameters when a command needs to go through
multiple transactions.

This can be used as a base infrastructure for future patches related to
those commands, including reindex filtering and tablespace support.

Per discussion with people mentioned below, as well as Alvaro Herrera
and Peter Eisentraut.

Author: Michael Paquier, Justin Pryzby
Reviewed-by: Alexey Kondratov, Justin Pryzby
Discussion: https://postgr.es/m/X8riynBLwxAD9uKk@paquier.xyz

Branch
------
master

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

Modified Files
--------------
src/backend/catalog/index.c      |  22 +++---
src/backend/commands/cluster.c   |  19 +++--
src/backend/commands/indexcmds.c | 162 ++++++++++++++++++++++++++-------------
src/backend/commands/tablecmds.c |   4 +-
src/backend/commands/vacuum.c    |  10 +--
src/backend/tcop/utility.c       |  40 +---------
src/include/catalog/index.h      |  19 +++--
src/include/commands/cluster.h   |  13 ++--
src/include/commands/defrem.h    |   6 +-
src/include/commands/vacuum.h    |  27 ++++---
src/tools/pgindent/typedefs.list |   2 +
11 files changed, 175 insertions(+), 149 deletions(-)



Message-ID: <E1l1Mji-0005lg-Re@gemulon.postgresql.org>
Permalink:  ../E1l1Mji-0005lg-Re@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l1Mji-0005lg-Re@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: michael@paquier.xyz
  Subject: Re: pgsql: Refactor option handling of CLUSTER, REINDEX and VACUUM
  In-Reply-To: <E1l1Mji-0005lg-Re@gemulon.postgresql.org>
  References: <E1l1Mji-0005lg-Re@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