diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2016-03-10 12:07:33 +0000 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2016-03-10 12:07:33 +0000 |
commit | fcb4bfddb6ff46e4495b923987ed6a89bd256174 (patch) | |
tree | 7d82756759780dafa4eaa72742e2e1fb5991cdd7 /src | |
parent | 090b287fc59e7a44da8c3e0823eecdc8ea4522f2 (diff) | |
download | postgresql-fcb4bfddb6ff46e4495b923987ed6a89bd256174.tar.gz postgresql-fcb4bfddb6ff46e4495b923987ed6a89bd256174.zip |
Reduce lock level for altering fillfactor
FabrÃzio de Royes Mello and Simon Riggs
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/common/reloptions.c | 10 | ||||
-rw-r--r-- | src/test/regress/expected/alter_table.out | 24 |
2 files changed, 17 insertions, 17 deletions
diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 86b9ae1c3ce..ea0755a8785 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -100,7 +100,7 @@ static relopt_int intRelOpts[] = "fillfactor", "Packs table pages only to this percentage", RELOPT_KIND_HEAP, - AccessExclusiveLock + ShareUpdateExclusiveLock /* since it applies only to later inserts */ }, HEAP_DEFAULT_FILLFACTOR, HEAP_MIN_FILLFACTOR, 100 }, @@ -109,7 +109,7 @@ static relopt_int intRelOpts[] = "fillfactor", "Packs btree index pages only to this percentage", RELOPT_KIND_BTREE, - AccessExclusiveLock + ShareUpdateExclusiveLock /* since it applies only to later inserts */ }, BTREE_DEFAULT_FILLFACTOR, BTREE_MIN_FILLFACTOR, 100 }, @@ -118,7 +118,7 @@ static relopt_int intRelOpts[] = "fillfactor", "Packs hash index pages only to this percentage", RELOPT_KIND_HASH, - AccessExclusiveLock + ShareUpdateExclusiveLock /* since it applies only to later inserts */ }, HASH_DEFAULT_FILLFACTOR, HASH_MIN_FILLFACTOR, 100 }, @@ -127,7 +127,7 @@ static relopt_int intRelOpts[] = "fillfactor", "Packs gist index pages only to this percentage", RELOPT_KIND_GIST, - AccessExclusiveLock + ShareUpdateExclusiveLock /* since it applies only to later inserts */ }, GIST_DEFAULT_FILLFACTOR, GIST_MIN_FILLFACTOR, 100 }, @@ -136,7 +136,7 @@ static relopt_int intRelOpts[] = "fillfactor", "Packs spgist index pages only to this percentage", RELOPT_KIND_SPGIST, - AccessExclusiveLock + ShareUpdateExclusiveLock /* since it applies only to later inserts */ }, SPGIST_DEFAULT_FILLFACTOR, SPGIST_MIN_FILLFACTOR, 100 }, diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out index 7c88ddc9fed..3232cda0236 100644 --- a/src/test/regress/expected/alter_table.out +++ b/src/test/regress/expected/alter_table.out @@ -2065,19 +2065,19 @@ select * from my_locks order by 1; commit; begin; alter table alterlock set (fillfactor = 100); select * from my_locks order by 1; - relname | max_lockmode ------------+--------------------- - alterlock | AccessExclusiveLock - pg_toast | AccessExclusiveLock + relname | max_lockmode +-----------+-------------------------- + alterlock | ShareUpdateExclusiveLock + pg_toast | ShareUpdateExclusiveLock (2 rows) commit; begin; alter table alterlock reset (fillfactor); select * from my_locks order by 1; - relname | max_lockmode ------------+--------------------- - alterlock | AccessExclusiveLock - pg_toast | AccessExclusiveLock + relname | max_lockmode +-----------+-------------------------- + alterlock | ShareUpdateExclusiveLock + pg_toast | ShareUpdateExclusiveLock (2 rows) commit; @@ -2110,10 +2110,10 @@ rollback; -- test that mixing options with different lock levels works as expected begin; alter table alterlock set (autovacuum_enabled = off, fillfactor = 80); select * from my_locks order by 1; - relname | max_lockmode ------------+--------------------- - alterlock | AccessExclusiveLock - pg_toast | AccessExclusiveLock + relname | max_lockmode +-----------+-------------------------- + alterlock | ShareUpdateExclusiveLock + pg_toast | ShareUpdateExclusiveLock (2 rows) commit; |