sanitizedb fails due to triggers attempting to modify mutating tables
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Stuart Bishop |
Bug Description
sanitizedb.py turns all our foreign key constraints into ON DELETE CASCADE foreign key constraints to allow us to delete private data and all its dependencies.
Unfortunately, on some tables we have triggers. One limitation of triggers is that they should not modify a mutating table, which for us only becomes apparent with the cascading deletes.
psycopg2.
DETAIL: Key (duplicateof)=(42) is not present in table "bug".
CONTEXT: SQL statement "UPDATE Bug SET date_last_message = max_datecreated FROM ( SELECT BugMessage.bug, max(Message.
PL/pgSQL function "set_bug_
Related branches
- Stuart Bishop (community): Approve
-
Diff: 715 lines (+0/-701)3 files modifiedlib/lp/scripts/utilities/sanitizedb.py (+0/-597)
lib/lp/scripts/utilities/tests/test_sanitizedb.py (+0/-89)
utilities/sanitize-db.py (+0/-15)
Changed in launchpad-foundations: | |
status: | Triaged → Fix Committed |
milestone: | none → 3.1.12 |
Changed in launchpad-foundations: | |
milestone: | 3.1.12 → 3.1.11 |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
High priority since lots of people seem to want this for I don't know what reasons.