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

From: Wells Oliver <wells(dot)oliver(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Locks under the hood on re-mat and dropping triggers
Date: 2022-05-20 19:35:47
Message-ID: CAOC+FBUP248PG-n_w3i4z6FcLuf=X-KDkZ-F1F2OPnDgFbZDwQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

but what I am seeing is this lock even when the trigger and table are not
at all used by an entirely separate mat-view being re-materialized.

On Fri, May 20, 2022 at 12:12 AM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
wrote:

> 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
>

--
Wells Oliver
wells(dot)oliver(at)gmail(dot)com <wellsoliver(at)gmail(dot)com>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ron 2022-05-20 19:57:47 Re: Many databases ou many schemas
Previous Message aditya desai 2022-05-20 15:45:04 Steps to Install archived Postgres 9.3 and 9.6