temporal_tables VS pg_bitemporal

Compare temporal_tables vs pg_bitemporal and see what are their differences.

temporal_tables

Postgresql temporal_tables extension in PL/pgSQL, without the need for external c extension. (by nearform)

pg_bitemporal

Bitemporal tables in Postgres (by scalegenius)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
temporal_tables pg_bitemporal
6 7
576 140
4.0% 1.4%
4.9 0.0
5 months ago about 2 years ago
PLpgSQL PLpgSQL
GNU General Public License v3.0 or later BSD 3-clause "New" or "Revised" License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

temporal_tables

Posts with mentions or reviews of temporal_tables. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-10-20.
  • PostgreSQL temporal_tables extension in PL/pgSQL
    1 project | news.ycombinator.com | 6 Dec 2023
  • Versioning data in Postgres? Testing a Git like approach
    9 projects | news.ycombinator.com | 20 Oct 2023
    It was reimplemented in pure SQL here https://github.com/nearform/temporal_tables for this purpose
  • All the ways to capture changes in Postgres
    12 projects | news.ycombinator.com | 22 Sep 2023
    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

  • Show HN: I made a CMS that uses Git to store your data
    13 projects | news.ycombinator.com | 23 Oct 2022
    One of these Postgres-based implementations of SQL:2011's temporal versioning features might get you close enough:

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

  • How to implement row changes history?
    1 project | /r/PostgreSQL | 27 Jul 2021
    You don't really need to install an extension to use temporal tables, there is an alternative (https://github.com/nearform/temporal_tables) implemented purely as a plpgsql trigger so that it works everywhere.
  • Temporal Tables PostgreSQL Extension
    3 projects | news.ycombinator.com | 9 Apr 2021
    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.

pg_bitemporal

Posts with mentions or reviews of pg_bitemporal. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-02-24.
  • The Guide to PostgreSQL Data Change Tracking
    5 projects | news.ycombinator.com | 24 Feb 2024
    I feel like i keep yelling the following, but bitemporal tables.

    - https://aiven.io/blog/two-dimensional-time-with-bitemporal-d...

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

    4 timestamps and some ugly queries.

  • Eventual Business Consistency
    1 project | news.ycombinator.com | 5 Aug 2023
    People here may also be interested to see this analysis of the state of SQL:2011 "temporal table" feature adoption: https://illuminatedcomputing.com/posts/2019/08/sql2011-surve...

    I don't think much has really changed since, and I'm not sure Postgres is any closer to addressing this natively (although there have been extensions, e.g. https://github.com/scalegenius/pg_bitemporal).

  • Show HN: I made a CMS that uses Git to store your data
    13 projects | news.ycombinator.com | 23 Oct 2022
  • Record history / Temporal table question
    1 project | /r/PostgreSQL | 25 Feb 2022
    Something more sophisticated would be https://github.com/scalegenius/pg_bitemporal
  • PostgreSQL 14 Released
    1 project | /r/programming | 2 Oct 2021
  • Bitemporal History
    6 projects | news.ycombinator.com | 8 Apr 2021
    Sure, I can appreciate that native support for a feature like this is nice.

    As I understand it, most implementations (including another one for bitemporality[1]) involve either audit tables, as you mention, and/or additional support columns. It's as if the "now" representation is simply a narrow lens onto the underlying data.

    That said, PostgreSQL encodes and has battle-tested decades of database functionality including an ecosystem around those, so I'd be a little wary of switching technology even if it does solve one individual problem thoroughly. Everything has to start somewhere, though.

    [1] - https://github.com/scalegenius/pg_bitemporal

What are some alternatives?

When comparing temporal_tables and pg_bitemporal you can also consider the following projects:

temporal_tables - Temporal Tables PostgreSQL Extension

pgkit - Pgkit - Backup, PITR and recovery management made easy

Reladomo - Reladomo is an enterprise grade object-relational mapping framework for Java.

walex - Postgres change events (CDC) in Elixir

crux - General purpose bitemporal database for SQL, Datalog & graph queries. Backed by @juxt [Moved to: https://github.com/xtdb/xtdb]

pg-event-proxy-example - Send NOTIFY and WAL events from PostgreSQL to upstream services (amqp / redis / mqtt)

wasmer.io - The Wasmer.io website

maxwell - Maxwell's daemon, a mysql-to-json kafka producer

outstatic - Outstatic - A static CMS for Next.js

connectors - Connectors for capturing data from external data sources

Kirby - Kirby's core application folder