| From: | Jerry Sievers <gsievers19(at)comcast(dot)net> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Shrikant Bhende <shrikantpostgresql(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Alter command getting stuck on a table |
| Date: | 2020-01-07 19:04:19 |
| Message-ID: | 877e23m6ks.fsf@jsievers.enova.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-admin |
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)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(dot)consulting(at)comcast(dot)net
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Keith Fiske | 2020-01-07 19:44:58 | Re: Moving child tables to partitions? |
| Previous Message | Wells Oliver | 2020-01-07 18:53:48 | Moving child tables to partitions? |