PostgreSQL foreign keys won't enforce restrictions the way you want them to; you'll have to use a trigger. And at that point, you might as well consider alternative designs... -- Scott Ribe scott_ribe@xxxxxxxxxxxxxxx http://www.killerbytes.com/ (303) 722-0567 voice ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster