Re: adding foreign key constraint locks up table

Поиск
Список
Период
Сортировка
От Florian Weimer
Тема Re: adding foreign key constraint locks up table
Дата
Msg-id 8239p8rd2f.fsf@mid.bfk.de
обсуждение исходный текст
Ответ на Re: adding foreign key constraint locks up table  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: adding foreign key constraint locks up table
Список pgsql-performance
* Tom Lane:

>> Do you mean that the ALTER query and subsequent queries are shown as
>> "waiting" in pg_stat_activity?  In this case, I'm also wondering why
>> this is inecessary.
>
> ALTER ADD FOREIGN KEY must lock both tables to add triggers to them.

But why is such a broad lock needed?  If the table was created in the
current transaction and is empty, the contents of the foreign key
table should not matter.

--
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99

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

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: Performance of PostgreSQL over NFS
Следующее
От: Greg Smith
Дата:
Сообщение: Re: concurrent IO in postgres?