Re: cascading lock issue

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: James Pang <jamespang886(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: cascading lock issue
Date: 2024-03-27 12:15:02
Message-ID: e22d27f5770e010a55c8fc5ab20e017e90d8e358.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, 2024-03-27 at 19:33 +0800, James Pang wrote:
> below is a cascading lock and blocking issue [...],
> new coming select on the table got blocked too. since only RowExclusiveLock
> granted on relation, why the query select got blocked too ? just because
> there is another "alter table" that's sitting in the queue before this
> "select session" ?  is it expected in PGv14?

Yes, it must be th ACCESS EXCLUSIVE lock that is waiting in line and blocking
everything else (locks have to queue).

Don't run ALTER TABLE when you have long running transactions/queries.

Yours,
Laurenz Albe

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tayyab Fayyaz 2024-03-27 12:35:03 Replication from PostgreSQL to Greenplum
Previous Message James Pang 2024-03-27 11:33:12 cascading lock issue