Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for other range types #26

Open
lifepillar opened this issue Jan 14, 2017 · 3 comments
Open

Support for other range types #26

lifepillar opened this issue Jan 14, 2017 · 3 comments

Comments

@lifepillar
Copy link

Any plan to support other range types, like int4range?

@arkhipov
Copy link
Owner

Hello @lifepillar,
Could you please clarify your idea?

@lifepillar
Copy link
Author

The idea is to use integers for versioning, where every transaction creates a new version (i.e., increases the current version number by one). Something similar to what is described in this paper (except that I am not interested in tracking schema changes, just data). One motivation is that integers would be monotonically increasing, while timestamps may be affected by errors.

Actually, I haven't thought too hard about it: it may be that it's something more easily said than done. I was mainly curious to know if that is an option that you have already considered (and, possibly, ruled out).

@arkhipov
Copy link
Owner

I have seen it implemented in some ORMs (Hibernate Envers is one the examples). The main issue of this approach is the version table. It may become a bottleneck, so you often have to divide your table graph in a set of independent strongly connected components which complicates the system design.

I do not think that possible time errors are a real problem. Even when using the version table, you still may run into situations when due to NTP corrections or CPU clock skew the next timestamp turns out to be less than the previous one. You just move the problem from the history tables to the revision table. If the extension runs into such a situation, it just uses the next available timestamp as the 'now' value.

And what is more, you still cannot get a valid database snapshot at some specific point of time (because you still cannot put different records with the same revision on a single timeline). Neither does the temporal tables extension allow you to get such a snapshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants