Re: CREATE TABLE (with INHERITS) and ACCESS EXCLUSIVE locks

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CREATE TABLE (with INHERITS) and ACCESS EXCLUSIVE locks
Дата
Msg-id 14860.1144187581@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: CREATE TABLE (with INHERITS) and ACCESS EXCLUSIVE locks  ("Thomas F. O'Connell" <tfo@sitening.com>)
Ответы Re: CREATE TABLE (with INHERITS) and ACCESS EXCLUSIVE locks  ("Thomas F. O'Connell" <tfo@sitening.com>)
Список pgsql-general
"Thomas F. O'Connell" <tfo@sitening.com> writes:
> As for how this plays out in the real world, a pg_dumpall will start
> and run for a few hours. Sometime during that, this function might
> get called. When it does, an ACCESS EXCLUSIVE lock is held against
> the table identified as t13, here directly referenced only as a
> FOREIGN KEY.

It's the addition of a foreign key constraint that's biting you.  That
requires installing triggers on the pre-existing table (t13, also t14
in your example), and that requires an exclusive lock.

Since we don't currently allow any ON SELECT triggers, it's possible
that adding a trigger could be downgraded to just ExclusiveLock (which
wouldn't conflict with pg_dump's AccessShareLock), but I can't say that
I'm enthusiastic about that idea.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Spurious rows returned with left join?
Следующее
От: Edmund Bacon
Дата:
Сообщение: Re: Spurious rows returned with left join?