Re: Index creation problem

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: Index creation problem
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C208902CA1@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на Index creation problem  (Oliver Kohll - Mailing Lists <oliver.lists@gtwm.co.uk>)
Ответы Re: Index creation problem  (Oliver Kohll - Mailing Lists <oliver.lists@gtwm.co.uk>)
Список pgsql-general
Oliver Kohll wrote:
>> In the example you show, some connections are "idle in transaction".
>> Such connections can hold locks that block your CREATE INDEX.
>> Could you look at pg_locks if there is a lock that is not granted?
>> There could also be prepared transactions holding locks, if
>> you use that feature.
>
> Yes there was indeed an un-granted lock on the table. By logging all
SQL I think I've found the client
> code which is causing the problem, a line was added recently that
basically causes
>
> DROP INDEX IF EXISTS
> followed by
> CREATE INDEX
>
> to be run twice in quick succession. These are all in the same thread
and transaction so I wouldn't
> have thought there'd be a locking problem but it's the most likely
candidate at the moment.

You should always include the list in your replies -
other people might be interested in the solution.

There must be at least two transactions involved
to create a locking problem like you describe.
But since CREATE INDEX takes strong locks, it can
easily get locked by other "harmless" things.

Yours,
Laurenz Albe


В списке pgsql-general по дате отправления:

Предыдущее
От: GMAIL
Дата:
Сообщение: Re: Multiple Cluster on same host
Следующее
От: Shaun Thomas
Дата:
Сообщение: Re: Multiple Cluster on same host