On Mon, May 11, 2009 at 21:18, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> However, he can do that anyway via ALTER TABLE, which
> will happily take out AccessExclusiveLock before it checks any
> permissions. So I'm not seeing the point of risking unsafe behavior
> in LOCK TABLE.
I would rather fix ALTER TABLE to do something similar to test and
test-and-set... From a quick look TRUNCATE also seems to be prone to
this.