-
-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove table inheritance #8046
Comments
For files, I would like to change the design: to have one central file storage table with link tables to attach the files to other entities. This allows deduplication of files linked to more than one entity. |
I have not looked at the details yet, but that is inline with my first impressions. |
There are 4 tables that have children through inheritance.
xt/42-files.pg
:file_content
table based on existence of associated rows in thefile_*_links
tablesThere does not seem clear reasons why inherited tables are used. Covert all to regular tables. Then convert the used serial columns to use IDENTITY.
The reason for this is for clarity and improved code quality. Table inheritance is is often misunderstood.
From the Postgres docs, "Unique constraints and primary keys are not inherited in the current implementation. This makes the combination of inheritance and unique constraints rather dysfunctional."
The text was updated successfully, but these errors were encountered: