Re:PostgreSQL Rising
by dotborg2 on Friday July 20, 2012 @11:09AM
(#4271116)
table inheritance is cool, but it's also incomplete, docs are pretty clear on that
[ Parent
| on HN ]
Yeah, I want inherited unique constraints for things which are guaranteed unique in an inheritance tree.
However, there are ways around this. You can, for example, use a composite key with the something related to the specific table in it.
For example our note table (an abstract class if you will) has a note_class field which is set to different default values and with different check constraints on the child tables.
Also foreign keys are a bit of an annoyance in an inherited table environment.