question: foreign key constraints and AccessExclusive locks

From: Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: question: foreign key constraints and AccessExclusive locks
Date: 2013-01-06 03:08:58
Message-ID: CAKuK5J0SY-oM0syve0eGggoxDvx6f9+4m9hYg6JpPQ7C2Bm0XQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

When adding a foreign key constraint on tableA which references
tableB, why is an AccessExclusive lock on tableB necessary? Wouldn't a
lock that prevents writes be sufficient, or does PostgreSQL have to
modify *both* tables in some fashion? I'm using PostgreSQL 8.4 on
Linux.

--
Jon

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2013-01-06 03:13:12 Re: too much pgbench init output
Previous Message Tatsuo Ishii 2013-01-06 02:03:18 Re: too much pgbench init output