| In Postgres, all transactions should acquire their locks in the same order, but report storage and report partition deletion acquire them in opposite orders (the order of operations in the transactions). Report storage acquires locks on certnames, then reports, then resource_events, partition gc drops resource_events, the reports, then updates certnames (acquiring the locks in that order). |