7.1 REFERENCES contstraints - Mailing list pgsql-sql

From Michael Richards
Subject 7.1 REFERENCES contstraints
Date
Msg-id 3AF5C845.00008D.78696@frodo.searchcanada.ca
Whole thread Raw
Responses Re: 7.1 REFERENCES contstraints  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-sql
I see that the REFERENCES constraint is a little more restrictive in 
7.1. I need to have a table with a constraint so one of it's columns 
must exist in a second table. This is not a key, since there may be N 
columns in the second table that match. Any ideas on how I should 
create this?

CREATE table foo(
id serial,
permissions int4,
FOREIGN KEY (permissions) REFERENCES bar(permid));

used to work in 7.0 but now it complains with:
psql:ddl.sql:103: ERROR:  UNIQUE constraint matching given keys for 
referenced table "permissions" not found

-Michael
_________________________________________________________________    http://fastmail.ca/ - Fast Free Web Email for
Canadians

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: update error
Next
From: Stephan Szabo
Date:
Subject: Re: 7.1 REFERENCES contstraints