In SQL standards, I belive a SELECT query is valid in a check constraint:
CREATE TABLE foo (
a INT CHECK ( a IN ( SELECT b FROM bar WHERE .... ) )
}
However, this seems not to be the case (yet) in PostgreSQL.
Should I do this with Triggers instead? Are there any other elegent
methods of doing the same?
Ben