3 ms·
It seems a bit odd that they try so hard to avoid reporting an error. Any I/O operation can fail. Furthermore, any I/O operation with a timeout can fail unpredi
by skybrian 12y ago
It seems a bit odd that they try so hard to avoid reporting an error. Any I/O operation can fail. Furthermore, any I/O operation with a timeout can fail unpredictably, since a timeout introduces a race condition.
- masklinn 12y ago> It seems a bit odd that they try so hard to avoid reporting an error. Is it really? If an upsert can race, deadlock or trigger constraint violation there's no point to having it, existing construct can race, deadlock or violate constraints just fine.
- petergeoghegan 12y agoAvoiding reporting an error only extends to errors that the user can reasonably hope to avoid, like spurious duplicate violations (from the "arbiter unique index"), and what I call unprincipled deadlocks (deadlocks where there is no user-visible mutual dependency, that users can't really do anything about except not use UPSERT so much). The point of UPSERT is that you're not supposed to have to worry about those. Obviously if you run out of disk space or something like that, that will throw an error aborting the transaction.