I've got this problem at a postgres database. I have four tables of location data (hospitals, schools, markets and police precints), slightly different between themselves, and a event report table that has a location column, referencing a location.
How can I make this reference, to a id that can be in any of the location tables? I've tried to reference a parent table of them all, but inserts return an error of "key not present at table"
Thanks
Per Kouber Saparev's suggestion, I've removed the inheritance and used foreign keys to reference the parent from the children. It's working perfectly now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With