mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +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:
@ -298,8 +298,9 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
|
||||
* it against access by any other process until commit (by which time it
|
||||
* will be gone).
|
||||
*/
|
||||
OIDNewHeap = make_new_heap(matviewOid, tableSpace, relpersistence,
|
||||
ExclusiveLock);
|
||||
OIDNewHeap = make_new_heap(matviewOid, tableSpace,
|
||||
matviewRel->rd_rel->relam,
|
||||
relpersistence, ExclusiveLock);
|
||||
LockRelationOid(OIDNewHeap, AccessExclusiveLock);
|
||||
dest = CreateTransientRelDestReceiver(OIDNewHeap);
|
||||
|
||||
|
Reference in New Issue
Block a user