Jan,
If a.x is unique, then (b.x, b.y) references (a.x, a.y) is only ensuring that the redundant copy of y in b.y stays in sync with a.y.
So? What's denormalized about that? His other choice is to use a trigger.
Because the value in b.y is redundant. b.x->a.x->a.y is exactly the same value and he even wants to ensure this with the constraint.
Jan
What he's trying to do is ensure that the class selected for the FK class_name, field_name relates to the same class_name in objects.
-- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== [EMAIL PROTECTED] #
---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html