From 47167b7907a802ed39b179c8780b76359468f076 Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Fri, 14 Aug 2015 14:19:28 +0100 Subject: Reduce lock levels for ALTER TABLE SET autovacuum storage options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reduce lock levels down to ShareUpdateExclusiveLock for all autovacuum-related relation options when setting them using ALTER TABLE. Add infrastructure to allow varying lock levels for relation options in later patches. Setting multiple options together uses the highest lock level required for any option. Works for both main and toast tables. Fabrízio Mello, reviewed by Michael Paquier, mild edit and additional regression tests from myself --- src/backend/commands/tablecmds.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/backend/commands/tablecmds.c') diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 970abd4b50c..126b11923f0 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -3038,16 +3038,12 @@ AlterTableGetLockLevel(List *cmds) * are set here for tables, views and indexes; for historical * reasons these can all be used with ALTER TABLE, so we can't * decide between them using the basic grammar. - * - * XXX Look in detail at each option to determine lock level, - * e.g. cmd_lockmode = GetRelOptionsLockLevel((List *) - * cmd->def); */ case AT_SetRelOptions: /* Uses MVCC in getIndexes() and * getTables() */ case AT_ResetRelOptions: /* Uses MVCC in getIndexes() and * getTables() */ - cmd_lockmode = AccessExclusiveLock; + cmd_lockmode = AlterTableGetRelOptionsLockLevel((List *) cmd->def); break; default: /* oops */ -- cgit v1.2.3