Subselects in CHECK clause ...

From: James Robinson <jlrobins(at)socialserve(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Subselects in CHECK clause ...
Date: 2006-11-29 17:08:12
Message-ID: 6881FC4D-8F7C-477B-9AAA-C9B5282D88B2@socialserve.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I see that subselects are not directly supported in check clauses,
but one can work around that by writing a stored function which
returns boolean and performs the subselect. Are there any known
gotchas with doing this?

The CREATE TABLE docs regarding CHECK clauses states:

"Currently, CHECK expressions cannot contain subqueries nor refer to
variables other than columns of the current row."

Is this due to someone not yet writing the necessary code to remove
the subquery clause, or is there a more fundamental reason?

----
James Robinson
Socialserve.com

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Aaron Bono 2006-11-29 17:23:54 Re: consistent random order
Previous Message Jeff Herrin 2006-11-29 16:38:17 consistent random order