From: Laurenz Albe <laurenz.albe@cybertec.at>
To: James Pang <jamespang886@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: cascading lock issue
Date: Wed, 27 Mar 2024 13:15:02 +0100
Message-ID: <e22d27f5770e010a55c8fc5ab20e017e90d8e358.camel@cybertec.at> (raw)
In-Reply-To: <CAHgTRff0eWtJ4tRpaKy_4U+J+6o+cVX8C6Q5onrpA=fPCF6axw@mail.gmail.com>
References: <CAHgTRff0eWtJ4tRpaKy_4U+J+6o+cVX8C6Q5onrpA=fPCF6axw@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: laurenz.albe@cybertec.at, jamespang886@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: cascading lock issue
In-Reply-To: <e22d27f5770e010a55c8fc5ab20e017e90d8e358.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox