Constraint to ensure value does NOT exist in another table?

From: Mike Christensen <mike(at)kitchenpc(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Constraint to ensure value does NOT exist in another table?
Date: 2011-06-16 05:04:43
Message-ID: BANLkTineoT4gKz8vybDQJarVhtxSf-84-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I know I can setup a FK constraint to make sure Table1.ColA exists in
Table2.Key, however what if I want to do the reverse?

I want to ensure Table1.ColA does NOT exist in Table2.Key.. Can I do
this with any sort of CHECK constraint, trigger, custom function, etc?
Thanks!

Mike

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Christensen 2011-06-16 05:11:41 Re: You could be a PostgreSQL Patch Reviewer!
Previous Message Vikram A 2011-06-16 04:52:10 Re: PGP encrypt/decrypt - Prereqistes