Re: Does DROP TABLE on table A with foreign key to table B locks SELECT queries on table B?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Tomer Praizler <tomer(dot)praizler(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Does DROP TABLE on table A with foreign key to table B locks SELECT queries on table B?
Date: 2019-05-07 16:57:44
Message-ID: 2bdf0fe5679f44ebf56890dfd5c5ead21a0c0bc3.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Tomer Praizler wrote:
> I am running Postgres 10.X

Yes, dropping a table with a foreign key will take an ACCESS EXCLUSIVE lock
on the referenced table. I believe that is because it will drop a (system)
trigger on that table.

Yours,
Laurenz Albe

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Saifi Khan 2019-05-08 01:55:46 compiling PostgreSQL with --enable-llvm
Previous Message Tomer Praizler 2019-05-07 11:49:48 Does DROP TABLE on table A with foreign key to table B locks SELECT queries on table B?