Re: Locks under the hood on re-mat and dropping triggers

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Wells Oliver <wells(dot)oliver(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Locks under the hood on re-mat and dropping triggers
Date: 2022-05-20 07:12:12
Message-ID: 344acccba555f6a080e5937d7c6bb7af482d8f75.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, 2022-05-19 at 14:37 -0700, Wells Oliver wrote:
> Dropping triggers from some table yields a lock while a concurrent refresh of a materialized
> view in another schema entirely is running-- why is this?

That is because dropping a trigger requires a (brief) ACCESS EXCLUSIVE lock on the table,
which conflicts with all concurrent access to the table.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message khoff 2022-05-20 09:40:03 Re: bash or sql script to copy foreign table to locale table
Previous Message Ron 2022-05-20 05:05:13 Re: Postgres switchover and switchback