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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Foreign Unique Constraint



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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group