What does HackerNews think of temporal_tables?

Postgresql temporal_tables extension in PL/pgSQL, without the need for external c extension.

Language: PLpgSQL

#159 in Hacktoberfest
I enjoyed this blog. I think it provides a great succinct overview of various approaches native to Postgres.

For the "capture changes in an audit table" section, I've had good experiences at a previous company with the Temporal Tables pattern. Unlike other major RDBMS vendors, it's not built into Postgres itself, but there's a simple pattern [1] you can leverage with a SQL function.

This allows you to see a table's state as of a specific point in time. Some sample use cases:

- "What was this user's configuration on Aug 12?"

- "How many records were unprocessed at 11:55pm last night?"

- "Show me the diff on feature flags between now and a week ago"

[1]: https://github.com/nearform/temporal_tables

One of these Postgres-based implementations of SQL:2011's temporal versioning might get you close enough:

- https://github.com/nearform/temporal_tables

- https://github.com/xocolatl/periods

- https://github.com/scalegenius/pg_bitemporal

- https://github.com/arkhipov/temporal_tables

I haven't used any of them but I work on https://xtdb.com which is also implementing SQL:2011's temporal features :)

I was part of a team at NearForm using this for a project on an EC2 instance. In order to move to AWS RDS we had to recreate the functionality of temporal_tables as a PostgreSQL function, rather than extension.

When we switched, we found that although there were minor bugs, we didn't have any noticeable loss of performance and we have used it ever since for many projects.

https://github.com/nearform/temporal_tables

If you're also limited by cloud services and the extensions limitations, this is a great solution.