Re: [SQL] AccessExclusiveLock on CREATE TABLE REFERENCES deadlocks (formatted better)

2009-10-06 Thread Erik Jones
On Sep 22, 2009, at 9:55 AM, Bryce Nesbitt wrote: # SELECT l.locktype,c.relname,l.pid,l.mode,granted from pg_locks l,pg_class c where l.relation=c.oid order by relname,granted; locktype | relname | pid | mode | granted relation | article_key_idx

[SQL] AccessExclusiveLock on CREATE TABLE REFERENCES deadlocks (formatted better)

2009-09-22 Thread Bryce Nesbitt
Dear Postgres Gurus; I've just diagnosed a PostgreSQL 8.3.4 server which, about once a month, would deadlock shortly after 11pm. It had been doing this for years, and the prior response was simply to reboot everything. The culprit boils down to: # create table cache_table_20090921 ( site_key

[SQL] AccessExclusiveLock on CREATE TABLE REFERENCES deadlocks

2009-09-22 Thread Bryce Nesbitt
Dear Postgres Gurus; I've just diagnosed a PostgreSQL 8.3.4 server which, about once a month, would deadlock shortly after 11pm. It had been doing this for years, and the prior response was simply to reboot everything. The culprit boils down to: # create table cache_table_20090921 ( site_key

Re: [SQL] AccessExclusiveLock on CREATE TABLE REFERENCES deadlocks (formatted better)

2009-09-22 Thread Tom Lane
Bryce Nesbitt bry...@obviously.com writes: 1) Why the AccessExclusiveLock on create table? It has to install a trigger on the referenced table. There has been some discussion that maybe CREATE TRIGGER could take just ExclusiveLock and not AccessExclusiveLock, but it hasn't been done yet; and

Re: [SQL] AccessExclusiveLock on CREATE TABLE REFERENCES deadlocks (formatted better)

2009-09-22 Thread Bryce Nesbitt
Tom Lane wrote: Bryce Nesbitt bry...@obviously.com writes: 1) Why the AccessExclusiveLock on create table? It has to install a trigger on the referenced table. There has been some discussion that maybe CREATE TRIGGER could take just ExclusiveLock and not