Renato De Giovanni <[EMAIL PROTECTED]> writes:
> FOREIGN KEY (object_id, 'X') REFERENCES object (id, class_id)
Why not just store the class_id in the secondary table (if you're
concerned about space, consider using an int4 to represent class_id).
Then you can do a direct two-column foreign key constraint, plus add
a check constraint like CHECK(class_id = 'X').
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
- [SQL] Meta integrity Renato De Giovanni
- Re: [SQL] Meta integrity Josh Berkus
- Re: [SQL] Meta integrity Stephan Szabo
- Re: [SQL] Meta integrity Grigoriy G. Vovk
- Tom Lane
