From: Jerry Sievers <gsievers19@comcast.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Shrikant Bhende <shrikantpostgresql@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Alter command getting stuck on a table
Date: Tue, 07 Jan 2020 13:04:19 -0600
Message-ID: <877e23m6ks.fsf@jsievers.enova.com> (raw)
In-Reply-To: <4965.1578401074@sss.pgh.pa.us>
References: <CAMTQpJALSF2EvBqmdYCqKnXx-o2VQZ4+KRn1TsstudQukC0Ryg@mail.gmail.com>
<70527e5e5ca140cd0950c1e8c63e19221a207ddc.camel@cybertec.at>
<4965.1578401074@sss.pgh.pa.us>
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
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: gsievers19@comcast.net, tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, shrikantpostgresql@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: Alter command getting stuck on a table
In-Reply-To: <877e23m6ks.fsf@jsievers.enova.com>
* 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