mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02:12 +03:00
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
This commit is contained in:
@@ -2623,6 +2623,14 @@ alter_table_cmd:
|
||||
n->newowner = $3;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
/* ALTER TABLE <name> SET ACCESS METHOD <amname> */
|
||||
| SET ACCESS METHOD name
|
||||
{
|
||||
AlterTableCmd *n = makeNode(AlterTableCmd);
|
||||
n->subtype = AT_SetAccessMethod;
|
||||
n->name = $4;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
/* ALTER TABLE <name> SET TABLESPACE <tablespacename> */
|
||||
| SET TABLESPACE name
|
||||
{
|
||||
|
Reference in New Issue
Block a user