Re: Subqueries in Check() -- Still Intentionally Omitted? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Subqueries in Check() -- Still Intentionally Omitted?
Date
Msg-id 20080902224744.GN12610@alvh.no-ip.org
Whole thread Raw
In response to Subqueries in Check() -- Still Intentionally Omitted?  ("Richard Broersma" <richard.broersma@gmail.com>)
Responses Re: Subqueries in Check() -- Still Intentionally Omitted?
Re: Subqueries in Check() -- Still Intentionally Omitted?
List pgsql-general
Richard Broersma escribió:
> I am curious if the motivation is still valid for intentionally
> omitting check sub-queries. (what was the motivation to begin with?)

The problem is that you have to rerun the query to verify that the CHECK
condition still holds, whenever the table that the CHECK clause is
checking changes.  This is rather problematic, because we'd need to make
the system aware of such reverse dependencies.

The usual workaround is only enough protection if you trust that the
table referenced in the CHECK query does not change.  If the query
references something other than a table (say a function), it gets even
more messy.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: "Richard Broersma"
Date:
Subject: Subqueries in Check() -- Still Intentionally Omitted?
Next
From: Tom Lane
Date:
Subject: Re: Subqueries in Check() -- Still Intentionally Omitted?