4 ms·
There's the idea of temporal tables, https://pgxn.org/dist/temporal_tables/ https://pgxn.org/dist/temporal_tables/ It's not a standard (I think) but it'd let y
by simcop2387 4y ago
There's the idea of temporal tables, https://pgxn.org/dist/temporal_tables/ https://pgxn.org/dist/temporal_tables/
It's not a standard (I think) but it'd let you do a cascading delete and then be able to go and look at the old objects as they were at time of deletion too.
You'd need to do things very differently to show a list of deleted objects though.
- sa46 4y agoYou lose traditional FK constraints with temporal tables since there's multiple copies of a row. One workaround is to partition current rows separately from historical rows and only enforce FK constraints on the current partition.
- dspillett 4y ago> temporal tables … It's not a standard They were introduced in ANSI SQL 2011. How closely implementations follow the standard I don't know, but something close exists in several DBMSs: I use them regualrly in MS SQL Server, there are plug-ins for postgres, MariaDB has them, and so forth.
- psYchotic 4y agoIt appears that there's been an attempt at standardizing temporal features in SQL in the SQL:2011 standard: https://en.wikipedia.org/wiki/SQL:2011 https://en.wikipedia.org/wiki/SQL:2011
- simcop2387 4y agoNeat I didn't know that had happened. I can't say I follow SQL standards all that thoroughly.