Jump to content

Archived

This topic is now archived and is closed to further replies.

radalin

Auto delete options

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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
AFAIK, Windows has a different task scheduler -- something with AT command, I think. And I agree -- scheduling is definitely the way to go.

Share this post


Link to post
Share on other sites
Do you know if there is such an option like a scheduled task in postgresql

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.