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

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 (view raw or flat)
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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group