Skip site navigation (1) Skip section navigation (2)

CHECK constraint

From: Ben Clewett <B(dot)Clewett(at)roadrunner(dot)uk(dot)com>
To:
Cc: pgsql-novice(at)postgresql(dot)org
Subject: CHECK constraint
Date: 2003-03-13 14:35:40
Message-ID: 3E70973C.9080708@roadrunner.uk.com (view raw or flat)
Thread:
Lists: pgsql-novice
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


In response to

Responses

pgsql-novice by date

Next:From: paul butlerDate: 2003-03-13 14:49:21
Subject: Re: CHECK constraint
Previous:From: Ben ClewettDate: 2003-03-13 13:34:13
Subject: Version Number

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group