Re: Literals in foreign key definitions - Mailing list pgsql-general

From Tom Lane
Subject Re: Literals in foreign key definitions
Date
Msg-id 17420.1265295639@sss.pgh.pa.us
Whole thread Raw
In response to Literals in foreign key definitions  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
List pgsql-general
Alban Hertroys <dalroi@solfertje.student.utwente.nl> writes:
>     FOREIGN KEY (base, true) REFERENCES unitclass (name, is_baseclass),
>     FOREIGN KEY (derived, false) REFERENCES unitclass(name, is_baseclass)

> I can of course add a few triggers to force that constraint, but I think it would be nice if the above syntax could
bemade to work. Or is this already in 8.4 or 8.5 or is this a can of worms? Does the SQL spec disallow it? 

Yes.  FK constraints have to be columns vs. columns --- otherwise they
can't be represented in the information_schema views.

            regards, tom lane

pgsql-general by date:

Previous
From: Chris Barnes
Date:
Subject: Postgres wal shipping from 8.33 to 8.42.
Next
From: Magnus Hagander
Date:
Subject: Re: Versions RSS page is missing version(s)