For the actual requirement of DB load I can live with what perl sort does: it assumes that the sort is well-defined. And it is, provided the required insertion order actually exists. If there is no solution for the comparison rules, perl sort will break one or more of these rules and deliver anyway a permutation of the list. That permutation will not be a solution to an insoluble schedule and the database will complain. That's fine if I have a single transaction for the entire load and can roll back, which is not difficult to arrange, using DBI.