Jump to content

Auto delete options


radalin

Recommended Posts

I'm curious if there is a way to autodelete rows after a period of time of inactivity or only after a period of time. Maybe there is a way with scheduled tasks or another way, which checks rows for a time and delete rows that are created one day ago?

Triggers or procedures can solve this? In mysql or pgsql or another database is such thing exists?

Thank you for your time.
Link to comment
Share on other sites

The "old school" way is to use a CRON job; but MySQL 5.1 supposedly has an event scheduler which will allow you to do just this without an external program (though I've never actually used it). In principle, you could add a trigger to run, but that's too much extra work for every single statement.
Link to comment
Share on other sites

[!--quoteo(post=381758:date=Jun 8 2006, 11:08 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jun 8 2006, 11:08 PM) [snapback]381758[/snapback][/div][div class=\'quotemain\'][!--quotec--]
The "old school" way is to use a CRON job; but MySQL 5.1 supposedly has an event scheduler which will allow you to do just this without an external program (though I've never actually used it). In principle, you could add a trigger to run, but that's too much extra work for every single statement.
[/quote]

Hi

I have the same problem with my website.

How does this CRON job work and where do I get it.
Link to comment
Share on other sites

Yeah a simple example could be great with cron as i did not understand too much from the examples I found. Also can I work with cron in windows.

And also what if i implement in my code such an execution. At every time my page will be called that function will be executed. But I think it's better if I implement it as a scheduled task.
Link to comment
Share on other sites

[!--quoteo(post=382072:date=Jun 9 2006, 05:44 PM:name=radalin)--][div class=\'quotetop\']QUOTE(radalin @ Jun 9 2006, 05:44 PM) [snapback]382072[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Do you know if there is such an option like a scheduled task in postgresql
[/quote]
I have no idea... never used it.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.