Re: Full table lock dropping a foreign key - Mailing list pgsql-general

From Tom Lane
Subject Re: Full table lock dropping a foreign key
Date
Msg-id 1370.1536170544@sss.pgh.pa.us
Whole thread Raw
In response to Full table lock dropping a foreign key  (Paul Jungwirth <pj@illuminatedcomputing.com>)
List pgsql-general
Paul Jungwirth <pj@illuminatedcomputing.com> writes:
> I noticed that Postgres takes an AccessExclusiveLock (a lock on the 
> whole table) against the *referenced* table when dropping a foreign key. 

Yeah, that's because it involves removing a trigger.

Adding a trigger used to require AEL as well, but it was successfully
argued that that end of things could use a weaker lock.  I find the
reasoning rather dubious myself.

            regards, tom lane


pgsql-general by date:

Previous
From: Johnes Castro
Date:
Subject: RE: Max number of WAL files in pg_xlog directory for Postgres 9.2version
Next
From: David Pacheco
Date:
Subject: Re: Autovacuum degrades all other operations by keeping all buffers dirty?