Re: Exclusive Locks Taken on User Tables?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Exclusive Locks Taken on User Tables?
Дата
Msg-id 4730BEF7.9090507@archonet.com
обсуждение исходный текст
Ответ на Exclusive Locks Taken on User Tables?  (Marc <pgsql-general@mbreslow.net>)
Ответы Re: Exclusive Locks Taken on User Tables?
Список pgsql-general
Marc wrote:
> Hi,
>
> I'm seeing an "EXCLUSIVE" lock being taken on a table even though the
> documentation says that "This lock mode is not automatically acquired on
> user tables by any PostgreSQL command."

Hmm - are you sure?

> My SQL is
> UPDATE users SET online = $1 where username = $2
>
> username is the PK on the users table.

Difficult to believe that's locking the whole table.

> Other locks taken by the transaction are 1 RowExclusiveLock for the users
> table and 1 RowExclusiveLock on each of the 6 explict indexes on that table
> and another for the implicity users_pkey index.

Fair enough.

> The result of these locks is that concurrent calls for the same statement
> are being serialized because the ExclusiveLock being requested is not being
> granted.

Doesn't sound right.

Are you sure your ExclusiveLock isn't on a "transactionid" rather than a
"relation"? Every transaction has an exclusive lock on itself.

Are you sure subsequent transactions affecting that row aren't just
waiting to see if the original commits? That's normal behaviour.

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Syntax error in a large COPY
Следующее
От: Marc
Дата:
Сообщение: Re: Exclusive Locks Taken on User Tables?