A new feature in 3.10a2 was to reuse object ids that were allocated during a transaction that was later aborted. However, Connection._rollback has not been updated to do the same. This means that rolling back to a savepoint made before the connection joined the transaction (which is indistinguishable from an abort) has a different effect on the un-created objects than rolling back to a savepoint made after. This is not usually a problem, as these objects are in an undefined state anyway (they are not "rolled back" because we have no state to roll back to). However, for consistency I think we should reuse the oids in the same transaction as well. Here is a patch (with tests) that does that.