4 ms·
Temporal tables in SQL server fit this use-case[0], I think. 0: https://learn.microsoft.com/en-us/sql/relational-databases/tables/temporal-tables https://learn
by hypeatei 2y ago
Temporal tables in SQL server fit this use-case[0], I think.
0: https://learn.microsoft.com/en-us/sql/relational-databases/tables/temporal-tables https://learn.microsoft.com/en-us/sql/relational-databases/t...
- rjbwork 2y agoAvailable on postgres as an extension. It's a bit jank and doesn't have language integrated clauses like sql server.
- WorldMaker 2y agoTemporal 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.
- rjbwork 2y agoIndeed...it's why I still pick MS SQL for certain projects.
- ajuc 2y agoOracle 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.
- WorldMaker 2y agoTemporal 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.
- mastax 2y agoAlso System-Versioned Tables in MariaDB: https://mariadb.com/kb/en/system-versioned-tables/ https://mariadb.com/kb/en/system-versioned-tables/