0

I have created a database and it is going to have some temporary values such as login type and some hask keys that I want it to be deleted after certain period of time.

I have installed postgres on docker.

I found out a solution through pgagent, but I don't know if it works on docker. Can anyone help me figure out how to do it?

Thanks in advance

ebbishop
  • 1,833
  • 2
  • 20
  • 45
  • 3
    Does this answer your question? https://stackoverflow.com/questions/26046816/is-there-a-way-to-set-an-expiry-time-after-which-a-data-entry-is-automaticall – Jan Held Feb 21 '20 at 12:26

1 Answers1

0

You can create the function/procedure to delete the records based on the criteria.

Schedule the execution of the function either using the cron job or the pgagent to execute at the specified time. For executing on the cron job you need to create the shell scrip to call from the cron job.

Arun Kumar
  • 11
  • 1