Re: Subqueries in Check() -- Still Intentionally Omitted?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Subqueries in Check() -- Still Intentionally Omitted?
Date: 2008-09-02 22:47:44
Message-ID: 20080902224744.GN12610@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-09-02 22:57:05 Re: Subqueries in Check() -- Still Intentionally Omitted?
Previous Message Joseph S 2008-09-02 22:31:35 Index non-usage problem in 8.2.9