Re: [HACKERS] DROP TABLE inside transaction block

Поиск
Список
Период
Сортировка
От Vadim Mikheev
Тема Re: [HACKERS] DROP TABLE inside transaction block
Дата
Msg-id 37D481F4.4A9FA60B@krs.ru
обсуждение исходный текст
Ответ на Re: [HACKERS] DROP TABLE inside transaction block  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> 
> "Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> >> That's a good point --- we acquire exclusive lock anyway on a table
> >> about to be deleted, so just holding that lock till end of transaction
> >> should prevent other backends from trying to touch the table.
> 
> > That reminds me.
> > DROP TABLE doesn't hold exlusive lock till end of transaction.
> > UnlockRelation() seems too early.
> 
> I wondered about that too --- but I didn't change it because I wasn't
> sure it was wrong.  Vadim, what do you think?

I remember that Hiroshi reported about this already and
seems we decided to remove UnlockRelation from heap_destroy_with_catalog(),
but forgot to do it?

> 
> > Seems ALTER TABLE doesn't acquire any lock for the target
> > relation. It's OK ?
> 
> None?  Yipes.  Seems to me it should *definitely* be grabbing
> AccessExclusiveLock.

Yes.

Vadim


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] DROP TABLE inside transaction block
Следующее
От: Philip Warner
Дата:
Сообщение: Re: [HACKERS] DROP TABLE inside transaction block