Add support for SET ACCESS METHOD in ALTER TABLE
authorMichael Paquier <michael@paquier.xyz>
Wed, 28 Jul 2021 01:10:44 +0000 (10:10 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 28 Jul 2021 01:10:44 +0000 (10:10 +0900)
commitb0483263dda0824cc49e3f8a022dab07e1cdf9a7
treee9aa48baf7b4159eae107a8a3cfb613927f9a854
parent4b763ff642e1a3608cbcaff062f6c2f465bfc6bd
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
doc/src/sgml/ref/alter_table.sgml
src/backend/commands/cluster.c
src/backend/commands/matview.c
src/backend/commands/tablecmds.c
src/backend/parser/gram.y
src/bin/psql/tab-complete.c
src/include/commands/cluster.h
src/include/commands/event_trigger.h
src/include/nodes/parsenodes.h
src/test/regress/expected/create_am.out
src/test/regress/sql/create_am.sql