Add support for SET ACCESS METHOD in ALTER TABLE

Michael Paquier <michael@paquier.xyz>

Commit: b0483263dda0824cc49e3f8a022dab07e1cdf9a7
Author: Michael Paquier <michael@paquier.xyz>
Date: 2021-07-28T01:10:44Z
Releases: 15.0
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

Files

Documentation touched

Discussion