Open ajwerner opened 4 years ago
A proposal here is to provide the option of returning a special bool column: RETURNING crdb_is_update
(or crdb_inserted
?)
We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!
Is your feature request related to a problem? Please describe.
In PostgreSQL you can add a
RETURNING (xmax = 0) AS inserted
clause to determine which occurred. We really don't have an equivalent story.Describe the solution you'd like I'm not sure. Given
xmax
and its semantics are never going to feature in cockroach, we'd need something else here. One thought is to lean on or extend the work in https://github.com/cockroachdb/cockroach/issues/50102 to provide access to the MVCC timestamp of the row when it was read in anUPDATE
/UPSERT
? To be honest, the value we're going to hand back during a transaction for that is weird, it's the provisional commit timestamp, but you know that it's above any previously read value and less than or equal to the commit timestamp.Jira issue: CRDB-4123