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

Alternatively, you can automate this with triggers, where the client only needs to know about the entity table, but all updates to an entity cause the previous value to be inserted into another table entity_log. We do this and it works well for us.


See also the Temporal Tables extension to PostgreSQL https://github.com/arkhipov/temporal_tables


The whole point of storing history is ability for clients to explicitly query it (and sometimes manipulate it), isn't it?


You can query a history table.


Not if "client only needs to know about the entity table"


So If you need to give history access to your client I guess you can put up a "entity_history" function that will generate a snapshot entity table from his request and the log table.

It all depend on your need, RDMS schema are customely build to meet customers needs, I don't believe in proverbial Swiss knife tool anymore.




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

Search: