Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Temporal tables are an implementation of one of SQL 2011's main features: system time.

https://sigmodrecord.org/publications/sigmodRecord/1209/pdfs...

Postgres itself has not yet added such to the core, since it moves about as fast as an elephant. There are extensions that do implement it (https://wiki.postgresql.org/wiki/Temporal_Extensions).



Help me here please. I really do not see how

WHERE CURRENT_TIMESTAMP BETWEEN start AND end is much better than WHERE deleted_at IS NOT NULL

Also, if we are talking about real use case of audit, not a simplified artificial one, my real tables were more like

changeset(id INT, timestamp DATETIME, user ^USER, host TEXT, ip_address TEXT, <other security data>)

datatable1(id INT, created_at ^changeset, updated_at ^changeset, deleted_at ^changeset NULL, <other fields>)

datatable2(id INT, created_at ^changeset, updated_at ^changeset, deleted_at ^changeset NULL, <other fields>)

datatable3(id INT, created_at ^changeset, updated_at ^changeset, deleted_at ^changeset NULL, <other fields>)


It is better, as others have written, because it preserves integrity constraints.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: