Re: Foreign Unique Constraint - Mailing list pgsql-sql

From Jon Horsman
Subject Re: Foreign Unique Constraint
Date
Msg-id 4f4c2a010703272051g94d88fdkc508a1b1ef189b34@mail.gmail.com
Whole thread Raw
In response to Re: Foreign Unique Constraint  ("Phillip Smith" <phillip.smith@weatherbeeta.com.au>)
List pgsql-sql
> Perhaps this...? It would work, but depending how many rows are in the
> table, it could become incredibly slow.

The max rows in either table would be about 1000 or so, which isn't
too many.  There also should be a hole lot of inserting going on.

> ALTER TABLE table1 ADD CHECK (extension NOT IN (SELECT extension FROM
> table2));

I guess this is the functionality i was looking for but was hoping
there would be a cleaner way to do it.

Anyways, thanks to everyone who replied.  I'll look into each of the
proposed solutions to see what best suits my needs.  If anyone has a
different solution i'd still like to hear it.

Jon


pgsql-sql by date:

Previous
From: "Phillip Smith"
Date:
Subject: Re: Foreign Unique Constraint
Next
From: Peter Eisentraut
Date:
Subject: Re: Foreign Unique Constraint