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: Add support for SET ACCESS METHOD in ALTER TABLE
Date: Wed, 28 Jul 2021 01:11:49 +0000
Message-ID: <E1m8Y6v-0007pk-P9@gemulon.postgresql.org> (raw)

Add support for SET ACCESS METHOD in ALTER TABLE

The logic used to support a change of access method for a table is
similar to changes for tablespace or relation persistence, requiring a
table rewrite with an exclusive lock of the relation changed.  Table
rewrites done in ALTER TABLE already go through the table AM layer when
scanning tuples from the old relation and inserting them into the new
one, making this implementation straight-forward.

Note that partitioned tables are not supported as these have no access
methods defined.

Author: Justin Pryzby, Jeff Davis
Reviewed-by: Michael Paquier, Vignesh C
Discussion: https://postgr.es/m/20210228222530.GD20769@telsasoft.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/ref/alter_table.sgml       | 20 ++++++++++
src/backend/commands/cluster.c          | 21 ++++++++---
src/backend/commands/matview.c          |  5 ++-
src/backend/commands/tablecmds.c        | 66 +++++++++++++++++++++++++++++++--
src/backend/parser/gram.y               |  8 ++++
src/bin/psql/tab-complete.c             | 11 +++++-
src/include/commands/cluster.h          |  4 +-
src/include/commands/event_trigger.h    |  1 +
src/include/nodes/parsenodes.h          |  1 +
src/test/regress/expected/create_am.out | 34 +++++++++++++++++
src/test/regress/sql/create_am.sql      | 17 +++++++++
11 files changed, 173 insertions(+), 15 deletions(-)



Message-ID: <E1m8Y6v-0007pk-P9@gemulon.postgresql.org>
Permalink:  ../E1m8Y6v-0007pk-P9@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1m8Y6v-0007pk-P9@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: Add support for SET ACCESS METHOD in ALTER TABLE
  In-Reply-To: <E1m8Y6v-0007pk-P9@gemulon.postgresql.org>
  References: <E1m8Y6v-0007pk-P9@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