Windows Scheduling System ,SQL

Asked

Viewed 56 times

0

How do I create and run a sql(postgresql) command on the windows scheduling system?

My problem.

I have a postgresql database where I have two tables. One is client and the other is disk lease. I need to know if the location on that disc is past its delivery date. I want to do it automatically through the date.

1 answer

1

You can use a scheduling feature that runs within Postgresql, allowing you to run updates in the database, as in this example:

-- Delete old data on Saturday at 3:30am (GMT)
SELECT cron.schedule('30 3 * * 6', $$DELETE FROM events WHERE event_time < now() - interval '1 week'$$);
  • Is functional in windows ?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.