Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
neoden
· 1y ago · 0 comments
One could use a trigger for this. All we need is to setup a trigger that would delete all expired records looking at some timestamp column on update. That would eat up some latency but as was said, most projects would find it good enough anyway.
Comments
[–]
dmitry-vsl
1y ago
Probably better to use partitioned table and drop old partitions.
[–]
nhumrich
1y ago
I use pg cron for this. But I don't have a need for TTL to be to the minute accurate, or even to the hour.