I would like to create my own payroll engine as a website. In Oracle ERP applications it is a very common thing to have a start and an end date on tables, so that you can have varying values over time. The start and end date would also form the primary key of the table along with an id.

This allows for temporal changes (changes over time). Additional validation is normally also needed to prevent time overlaps. Another issue is that you could also query at a time where no data exists at that time range, and then you might want to jump to the nearest or last existing time range.

In Oracle's latest database release temporal validity has finally become a thing, see this link; but it still hasn't made it's way to for example Oracle APEX.

Surely specifying the time at which you want the value should be something that a lot of people would want, especially for salary over time, address, etc.

Why do web development frameworks (specifically Python Flask with SQL Alchemy and Postgresql) and tutorials for them never show how to do temporal data such as this or am I missing stuff that readily exists? Or what can I do to change this fact aside from writing it myself which I'm definitely not doing?

1 Answer 1


Why do web development frameworks (specifically Python Flask with SQLAlchemy and PostgreSQL) and tutorials for them never show how to do temporal data?

Handling temporal tables is a specific function of a given database. In contrast, tools such as Flask and SQLAlchemy are designed for a broad range of applications. Thus, the primary concern for tutorials on those tools would arguably be to show how to deliver content generally (whatever that content might be), rather than focusing on specific use cases. If an end user is sufficiently versed in a given framework, etc., designing an interface for temporal data should (in theory) be relatively simple.

As a side note, if you want a plugin to enable temporal tables in PostgreSQL, you should have a look at temporal_tables.

Not the answer you're looking for? Browse other questions tagged or ask your own question.