Hi everyone,
I having trouble working with a Postgres relational database. Basically what's happening is I'm reading from one (or many) XMLs files, transforming/combining/editing data then writing to a number of different Postgres tables which all link together via a primary key in the 'master' table. When the XML file(s) get updated and a record drops off, I need to delete that record from the master table but because of the related records in the other tables, I am unable to do so. Obviously the related records in the other tables need to be deleted as well (and apparently before I can delete the 'master' record).
Does anyone have some logic around how to make this work? It seems I need to find the deleted 'master' records (I'm using Update Detector at the moment), then somehow get a list of all of the related records in the other tables, delete them, then delete the 'master' record. Any tips or advice would be greatly appreciated!
Natasha