how do I set an expiry on rows?
# help
g
how do I set an expiry on rows?
n
Hello @gralp! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
🆕 Row expiry
g
so the row is deleted after x minutes or something
I could do it myself by storing a timestamp in it and looping through the whole table but is there a built in thing for it
a
There is no feature built in to delete rows automatically based on age. But if you regularly insert / update rows then you can create a function to drop rows older than x minutes and trigger it on insert/update or make your frontend call the function you can set a cron job otherwise,
n
Row expiry
g
cool
n
Thread was archived by @gralp. Anyone can send a message to unarchive it.
d
You can also look into the postgres cron extension and set something up like that