Re: Foreign Unique Constraint

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Cc: "Phillip Smith" <phillip(dot)smith(at)weatherbeeta(dot)com(dot)au>, "'Jon Horsman'" <horshaq(at)gmail(dot)com>
Subject: Re: Foreign Unique Constraint
Date: 2007-03-28 09:08:07
Message-ID: 200703281108.08697.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Am Mittwoch, 28. März 2007 00:17 schrieb Phillip Smith:
> Perhaps this...? It would work, but depending how many rows are in the
> table, it could become incredibly slow.
>
> ALTER TABLE table1 ADD CHECK (extension NOT IN (SELECT extension FROM
> table2));

Subqueries are not allowed in check constraints.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message ezequias 2007-03-28 12:25:41 Re: Regular Expressions [progress]
Previous Message Jon Horsman 2007-03-28 03:51:35 Re: Foreign Unique Constraint