postgresql-tableversion icon indicating copy to clipboard operation
postgresql-tableversion copied to clipboard

Forbid having _revision_expired < _revision_added in _revision tables

Open strk opened this issue 7 years ago • 5 comments

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

strk avatar Feb 14 '18 10:02 strk

Would be good to understand the performance hit of such a constraint

palmerj avatar Feb 14 '18 11:02 palmerj

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 ?

strk avatar May 09 '18 08:05 strk

PR #121 is ready for review/test

strk avatar May 10 '18 15:05 strk

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.

stale[bot] avatar Nov 10 '18 10:11 stale[bot]

Still relevant.

imincik avatar Nov 10 '18 17:11 imincik