Skip to main content

Timeline for how to chain postgres RULEs?

Current License: CC BY-SA 3.0

6 events
when toggle format what by license comment
Mar 16, 2013 at 19:22 history migrated from stackoverflow.com (revisions)
Mar 16, 2013 at 7:41 comment added Chris Travers If you want to delete unconditionally, don't use rules to do it. Rules are fundamentally conditional and this is your problem (having to scan multiple tables to see what should be deleted). Use a user-defined function instead.
Mar 15, 2013 at 12:00 comment added Milovan Zogovic But I DO want to delete unconditionally. Data in stats table is imported on daily basis. I want to be able to delete data for WHOLE day, and import the new data. Thanks for your help man.
Mar 13, 2013 at 13:59 comment added wildplasser You don't want to delete (uncoditionally). For instance: You only want to delete from application_hits if there is stil one ore more records with the same {zday, application_id} in client_hits. there can be more than one records in client_hits with the same {zday, application_id}, but with a different client_id. (You do want to delete if the hitcount goes to zero, but that's a different issue)
Mar 13, 2013 at 13:28 comment added Milovan Zogovic Thanks! This is really helpful. However, the only thing i want to do is to DELETE records. There is external system which detects missing dates and recalculates the values (see latest update). I'll check your script a bit more and see how i can make use of it..
Mar 13, 2013 at 12:33 history answered wildplasser CC BY-SA 3.0