Josh Berkus <josh(at)agliodbs(dot)com> writes:
> I understand why establishing an FK needs an ExclusiveLock on the
> referenced table, but it doesn't need an AccessExclusiveLock.
Yes, it does, because it's adding triggers. We can't improve this
in the near term, and complaining about it doesn't change that.
At the very least we need MVCC catalog scans before we can think
about reducing lock levels for DDL. I forget whether there are any
other issues...
regards, tom lane