In our project, we have a lot of benefits from the PostgreSQL database inheritance function!
We implement the dynamic creation of schemes for different agencies. This structure allows us to solve many security problems that arise directly in the case of bulk tables (without partitioning).
The only problem we have encountered is to guarantee the integrity of the database, which is usually (in the sense of a structure without inheritance) implemented by foreign key constraints.
Since PostgreSQL has certain limitations (see inheritance warnings ), we are forced to maintain the table structure without restriction.
Is it possible to "simulate", even assuming a relative performance gap, foreign key constraints using triggers and / or checks?
Any suggestions are greatly appreciated! Thank.
source
share