Re: pg_get_expr() hangs with uncommitted DDL transaction

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_get_expr() hangs with uncommitted DDL transaction
Date: 2014-11-11 15:56:31
Message-ID: m3tbjf$ltu$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane schrieb am 11.11.2014 um 16:35:
>> 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.

Not sure I understand this.

Extracting the attribute names and data types from the various pg_catalog tables
works _without_ the query being blocked. Even when selecting all arguments that
are passed to pg_get_expr().

It's only when adding the function call to an otherwise perfectly working query
that this wait occurs.

Does this mean that pg_get_expr() selects additional data from the table,
instead of just using the values that are provided by the caller?

Thomas

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2014-11-11 16:08:46 Re: pg_get_expr() hangs with uncommitted DDL transaction
Previous Message Tom Lane 2014-11-11 15:35:22 Re: pg_get_expr() hangs with uncommitted DDL transaction