Re: ALTER TABLE SET STATISTICS requires AccessExclusiveLock

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-hackers@postgresql.org
Date: 2009-08-07T14:10:19Z
Lists: pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Is there a good reason for $subject, other than that the code is entangled 
> with other ALTER TABLE code?

I think it could be lower, but it would take nontrivial restructuring of
the ALTER TABLE support.  In particular, consider what happens when you
have a list of subcommands that don't all require the same lock level.
I think you'd need to scan the list and find the highest required lock
level before starting ...

			regards, tom lane