4 ms·
At least with PostgreSQL, most of the features are really shortcuts, rather than kludges masquerading as features. E.g. - extending a table as if it were a sup
by Roboprog 14y ago
At least with PostgreSQL, most of the features are really shortcuts, rather than kludges masquerading as features. E.g. - extending a table as if it were a superclass, rather than creating a supplemental "joiner" table and creating a writeable view on top of the "super" table + the "sub" table.
- einhverfr 14y agoI wouldn't consider them shortcuts. I use table inheritance as an actual sort of inheritance, to enforce a consistent interface over a set of relations. Yes, that could be a shortcut but it also allows for foreign keys to be against different relations on each of the partitions. Yes, that could be done with partitioning in other ways, so maybe the short cut analogy works. But others? I don't know. The ability to write a stored procedure as a quick Perl regular expression and then call it from a SQL query doesn't strike me as a short-cut. Nor does the extensible type system, or the ability to caste complex types as simple types with defined functions. A lot of these are features which make PostgreSQL a development platform in a box, rather than a data store.
- dotborg2 14y agotable inheritance is cool, but it's also incomplete, docs are pretty clear on that
- einhverfr 14y agoYeah, 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.