Обсуждение: pgsql: Add support for SET ACCESS METHOD in ALTER TABLE

Поиск
Список
Период
Сортировка

pgsql: Add support for SET ACCESS METHOD in ALTER TABLE

От
Michael Paquier
Дата:
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(-)