
Table Inheritance: What's It Good For? - okket
http://ledgersmbdev.blogspot.com/2019/05/table-inheritance-whats-it-good-for.html
======
porsager
I've just been experimenting and evaluating inheritance for a new project for
the past week, and while I felt it could have been a great fit in some cases,
I choose not to use it due to the many recommendations to stay clear of it. I
finally felt good about my decision a couple of days ago when I saw the
"official" recommendation here:
[https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use...](https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_table_inheritance)

Now reading this post, I'm curious again :-) One case where I had inheritance
in mind was to track row ownership and dates for app users. For instance, I
currently have 56 tables which all contains the same columns (owned_by,
created_by, deleted_by, created_at, deleted_at). Now as far as I understand,
I'd still have to define foreign keys for owned_by, created_by and deleted_by
on each table, so I wasn't sure the gain of inheritance was good enough
considering potential downsides I wasn't able to evaluate properly without
more knowledge / experience. I think my case looks a lot like the notes
example, and I wonder if there are any pros/cons in using inheritance for a
case like this?

