Re: Cross-table constraints - Mailing list pgsql-sql

From Rodger Donaldson
Subject Re: Cross-table constraints
Date
Msg-id E18dlRn-0005Hl-00@israel.diaspora.gen.nz
Whole thread Raw
In response to Cross-table constraints  (Rodger Donaldson <rodgerd@diaspora.gen.nz>)
List pgsql-sql
> On Tue, 28 Jan 2003, Rodger Donaldson wrote:
> 
> > Now, adding a UNIQUE constraint on the pk for add_queue weeds out
> > dupes there.  However, attempting to add a cross-table UNIQUE check
> > with:
> >
> > alter table add_queue add constraint add_queue_no_dupe_sites unique
> > (sites.url);
> > ERROR:  parser: parse error at or near "."
> >
> > ,,,fails.  Foreign key constraints will only require a match (of one
> > sort or another) in the foreign table, according to the postgresql 
7.2
> > documentation, and do not have an option to require no match.
> >
> > Am I missing something obvious (syntax for UNIQUE, for example), or
> > trying to do something that just doesn't work that way?
> 
> I'm not sure what a unique constraint on sites.url on table add_queue
> is supposed to mean precisely.

Sorry; to clarify, it's table.column notation.


> You can probably come pretty close by making a set of triggers on 
> both tables however.

That's what I feared 8).

-- 
Rodger Donaldson
rodgerd@diaspora.gen.nz


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Cross-table constraints
Next
From: Stephan Szabo
Date:
Subject: Re: Creating tables from within functions