Re: pg_get_expr() hangs with uncommitted DDL transaction

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_get_expr() hangs with uncommitted DDL transaction
Date: 2014-11-11 15:35:22
Message-ID: 24253.1415720122@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Kellerer <spam_eater(at)gmx(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2014-11-11 15:56:31 Re: pg_get_expr() hangs with uncommitted DDL transaction
Previous Message Adrian Klaver 2014-11-11 13:58:49 Re: trigger Before or After