Re: Alter command getting stuck on a table

Поиск
Список
Период
Сортировка
От Shrikant Bhende
Тема Re: Alter command getting stuck on a table
Дата
Msg-id CAMTQpJB+TA-CTRyQ7rW00v-0PHMWGcfmwT_CypWSK_kcFwE=ag@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Alter command getting stuck on a table  (Jerry Sievers <gsievers19@comcast.net>)
Список pgsql-admin
Hello,

Thank you all, 
that helped me to get rid of the issues, using pg_locks and pg_stat_activity I was able to find out concurrent session which was not allowing to hold exclusive lock. 

Thanks 

On Wed, Jan 8, 2020 at 12:34 AM Jerry Sievers <gsievers19@comcast.net> wrote:
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 по дате отправления:

Предыдущее
От: Keith Fiske
Дата:
Сообщение: Re: Moving child tables to partitions?
Следующее
От: Wells Oliver
Дата:
Сообщение: COPY from STDIN vs file with large CSVs