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 some code for ALTER TABLE SET LOGGED/UNLOGGED in tablec
Date: Thu, 29 Aug 2024 06:31:50 +0000
Message-ID: <E1sjYhC-001wCk-0c@gemulon.postgresql.org> (raw)

Refactor some code for ALTER TABLE SET LOGGED/UNLOGGED in tablecmds.c

Both sub-commands use the same routine to switch the relpersistence of a
relation, duplicated the same checks, and used a style inconsistent with
access methods and tablespaces.

SET LOGEED/UNLOGGED is refactored to avoid any duplication, setting the
reason why a relation rewrite happens within ATPrepChangePersistence().
This shaves some code.

Discussion: https://postgr.es/m/ZiiyGFTBNkqcMQi_@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9f87da1cffda0e07ff3babcfa84abe9e849ccd95

Modified Files
--------------
src/backend/commands/tablecmds.c | 44 +++++++++++++---------------------------
1 file changed, 14 insertions(+), 30 deletions(-)



Message-ID: <E1sjYhC-001wCk-0c@gemulon.postgresql.org>
Permalink:  ../E1sjYhC-001wCk-0c@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1sjYhC-001wCk-0c@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Refactor some code for ALTER TABLE SET LOGGED/UNLOGGED in tablec
  In-Reply-To: <E1sjYhC-001wCk-0c@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