4 ms·
Table inheritance has some serious limitations regarding foreign keys and some other aspects. The following warning is in the official documentation in that ch
by fabian2k 8y ago
Table inheritance has some serious limitations regarding foreign keys and some other aspects. The following warning is in the official documentation in that chapter:
> These deficiencies will probably be fixed in some future release, but in the meantime considerable care is needed in deciding whether inheritance is useful for your application.
- pstuart 8y agoI think this is being addressed now: https://blog.2ndquadrant.com/enhancements-to-partitioning-and-indexes-in-postgresql-11/ https://blog.2ndquadrant.com/enhancements-to-partitioning-an...
- colanderman 8y agoPartitioned tables and child tables are different things; I'd be surprised if 2nd Q is actually is working on support for child tables. (Child tables I believe were historically used to implement partitioning, but Postgres now has native partitioning support.) There's no mention of FK support on child tables in the v11 release notes that I can find: https://www.postgresql.org/docs/11/static/release-11.html https://www.postgresql.org/docs/11/static/release-11.html
- pstuart 8y agoThanks. My bad.
- mephitix 8y agoHere is the section on the limitations. Having tried this out myself, please be aware that this is not really 'inheritance'. I had to ditch it completely from my design: https://www.postgresql.org/docs/current/static/ddl-inherit.html#DDL-INHERIT-CAVEATS https://www.postgresql.org/docs/current/static/ddl-inherit.h... For what I'm doing I got away with having insert/delete triggers on child tables that mirror their identity/type to a 'types' table. Also enforced through check constraints and FKs