Re: Why is LockClassinfoForUpdate()'s mark4update a good idea?

Поиск
Список
Период
Сортировка
От Hiroshi Inoue
Тема Re: Why is LockClassinfoForUpdate()'s mark4update a good idea?
Дата
Msg-id 3A639ADD.A612A90F@tpf.co.jp
обсуждение исходный текст
Ответ на Why is LockClassinfoForUpdate()'s mark4update a good idea?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Why is LockClassinfoForUpdate()'s mark4update a good idea?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> 
> Why does LockClassinfoForUpdate() insist on doing heap_mark4update?

Because I want to guard the target pg_class tuple by myself.
I don't think we could rely on the assumption that the lock on
the corresponding relation is held. For example, AlterTableOwner()
doesn't seem to open the corresponding relation.

> As far as I can see, this accomplishes nothing except to break
> concurrent index builds.  If I do
> 
>         create index tenk1_s1 on tenk1(stringu1);
>         create index tenk1_s2 on tenk1(stringu2);
> 
> in two psqls at approximately the same time, the second one fails with
> 
>         ERROR:  LockStatsForUpdate couldn't lock relid 274157
>

This is my fault. The error could be avoided by retrying 
to acquire the lock like "SELECT FOR UPDATE" does.

Regards.
Hiroshi Inoue


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

Предыдущее
От: ncm@zembu.com (Nathan Myers)
Дата:
Сообщение: Re: CRCs
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: copy from stdin; bug?