Last year, I questioned why CREATE TRIGGER acquires an
AccessExclusiveLock on its target table:
http://archives.postgresql.org/pgsql-hackers/2005-03/msg00764.php
Acquiring an ExclusiveLock should be sufficient: we can safely allow
concurrent SELECTs on the table. (The -hackers thread discusses both
CREATE TRIGGER and ALTER TABLE ADD FK; the latter might require some
more consideration, so I'll tackle that later.)
This patch implements this change, and updates the documentation.
Barring any objections, I'll apply this in a day or two.
-Neil