Forbid having _revision_expired < _revision_added in _revision tables
The function ver_get_$schema$_$table$_revision(p_revision integer) (and possibly other) assume that _revision_expired is always bigger or equal to _revision_added failing which no revision would ever be considered to contain the corresponding record of a table.
For this reason it would make sense to enforce such condition as an integrity constraint (a check).
Such database corruption was spotted and reported by downstream project here: https://github.com/linz/ds-dev-team/issues/46
Would be good to understand the performance hit of such a constraint
It could be now a good occasion to test that performance hit, do you want a PR for this @imincik for testing as part of your current performance analisys ?
PR #121 is ready for review/test
This issue has been automatically marked as stale as there has not been any activity for sometime. The issue will be closed in 14 days if no further activity.
Still relevant.