Re: pg_get_expr() hangs with uncommitted DDL transaction - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_get_expr() hangs with uncommitted DDL transaction
Date
Msg-id 25162.1415722126@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_get_expr() hangs with uncommitted DDL transaction  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: pg_get_expr() hangs with uncommitted DDL transaction  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-general
Thomas Kellerer <spam_eater@gmx.net> writes:
> 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?

No, it means it depends on backend code that is also used when accessing
the table "for real", and that code doesn't work safely without a lock.
(In particular, a lot of what ruleutils.c does ultimately reduces to
catalog cache lookups, and we can *not* allow stale data in those caches.)

In principle we could reimplement pg_get_expr and sibling routines as code
that just looks at the contents of the catalogs as they stood at the time
of the surrounding query's snapshot.  But that's not what they do today,
and getting from point A to point B would be a lot of work.

            regards, tom lane


pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: pg_get_expr() hangs with uncommitted DDL transaction
Next
From: Thomas Kellerer
Date:
Subject: Re: pg_get_expr() hangs with uncommitted DDL transaction