Re: Alter command getting stuck on a table - Mailing list pgsql-admin

From Jerry Sievers
Subject Re: Alter command getting stuck on a table
Date
Msg-id 877e23m6ks.fsf@jsievers.enova.com
Whole thread Raw
In response to Re: Alter command getting stuck on a table  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Alter command getting stuck on a table
List pgsql-admin
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Laurenz Albe <laurenz.albe@cybertec.at> writes:
>
>> On Tue, 2020-01-07 at 14:58 +0530, Shrikant Bhende wrote:
>>> I am trying to add a column to a table but it's not working, I have also tried
>>> reindex and drop on the same table but those commands are also getting stuck.
>
>> There is a concurrent session which has an open transaction which
>> holds some lock on the table in question.
>
> Yes, that looks like the cause.  The pg_locks view could help you
> find the culprit session.

Yeah, and IMO the pg_blocking_pids($blocked-guys-pid) function is pretty
snazzy too :-)


>             regards, tom lane
>
>
>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net



pgsql-admin by date:

Previous
From: Wells Oliver
Date:
Subject: Moving child tables to partitions?
Next
From: Keith Fiske
Date:
Subject: Re: Moving child tables to partitions?