Comment by hypeatei

2 months ago

Temporal tables in SQL server fit this use-case[0], I think.

0: https://learn.microsoft.com/en-us/sql/relational-databases/t...

Oracle has flashback queries (SELECT ... AS OF timestamp).

It's one of these things that are available but most people ignore it and implement it manually with created_at updated_at deleted_at columns etc. I think one reason for this is lack of support in ORMs and lack of standardization between RDBMSes.

  • Temporal Tables are ANSI Standard today (from SQL 2011). So far the closest to Standard is (surprisingly) Microsoft's SQL Server, but hopefully more of the DBs will pick up the standard sooner rather than later.

Available on postgres as an extension. It's a bit jank and doesn't have language integrated clauses like sql server.

  • Temporal Tables and their query language were formalized in ANSI SQL 2011 standard, so hopefully it is only a matter of time and resources to see it added into the postgres core directly.