Scheduling System Windows, SQL

0

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

My problem.

I have a postgresql database where I have two tables. One is a client and the other is a disk location. I need to know if the location of this disk has passed the delivery date. I want to do it automatically via the date.

    
asked by anonymous 15.02.2017 / 15:38

1 answer

1

You can use a scheduling feature that runs within PostgreSQL, allowing you to run updates to 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'$$);
    
15.02.2017 / 15:47