pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jon Horsman <horshaq@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Foreign Unique Constraint
Date: Tue, 27 Mar 2007 23:51:35 -0400
Message-ID: <4f4c2a010703272051g94d88fdkc508a1b1ef189b34@mail.gmail.com> (raw)
In-Reply-To: <002501c770bd$a42f94a0$9b0014ac@wbaus090>
References: <4f4c2a010703270621h5137a4e5rb515a9be9034a543@mail.gmail.com>
	<002501c770bd$a42f94a0$9b0014ac@wbaus090>

> 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



view thread (11+ messages)  latest in thread

Message-ID: <4f4c2a010703272051g94d88fdkc508a1b1ef189b34@mail.gmail.com>
Permalink:  ../4f4c2a010703272051g94d88fdkc508a1b1ef189b34@mail.gmail.com/
Also on:    postgresql.org/message-id/4f4c2a010703272051g94d88fdkc508a1b1ef189b34@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: horshaq@gmail.com
  Subject: Re: Foreign Unique Constraint
  In-Reply-To: <4f4c2a010703272051g94d88fdkc508a1b1ef189b34@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox