Re: pg_get_expr() hangs with uncommitted DDL transaction

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_get_expr() hangs with uncommitted DDL transaction
Дата
Msg-id 24253.1415720122@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pg_get_expr() hangs with uncommitted DDL transaction  (Thomas Kellerer <spam_eater@gmx.net>)
Ответы Re: pg_get_expr() hangs with uncommitted DDL transaction  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-general
Thomas Kellerer <spam_eater@gmx.net> writes:
> Is there a reason why pg_catalog.pg_get_expr() will wait until the exclusive lock on the table is released?

Yes.  It needs to extract attribute names, data types, etc for the target
table and it would also like to be sure that that data is self-consistent.
So it takes out AccessShareLock the same as a query on the table would.

There have been periodic debates about how it would be nice if this and
related ruleutils.c functions would work based on the calling query's
snapshot instead of trying to provide up-to-date info.  However, short
of a rather massive rewrite (and, probably, a lot of duplicative code)
that's not going to happen :-(

            regards, tom lane


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: trigger Before or After
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: pg_get_expr() hangs with uncommitted DDL transaction