Thread: Triggers: How to make one that fires at a certain time of day?

Triggers: How to make one that fires at a certain time of day?

From
Jean-Christian Imbeault
Date:
I'd like to have a table that generates a row entry everyday at
midnight. Is there anyway to create a trigger (or something else) that
would fire at midnight and insert a row into a table?

Thanks!

Jc


Re: Triggers: How to make one that fires at a certain time

From
dima
Date:
Jean-Christian Imbeault wrote:
> I'd like to have a table that generates a row entry everyday at
> midnight. Is there anyway to create a trigger (or something else) that
> would fire at midnight and insert a row into a table?
cron? psql "query"...


Re: Triggers: How to make one that fires at a certain

From
Oliver Elphick
Date:
On Mon, 2002-08-26 at 14:25, Jean-Christian Imbeault wrote:
> I'd like to have a table that generates a row entry everyday at
> midnight. Is there anyway to create a trigger (or something else) that
> would fire at midnight and insert a row into a table?

No; the database knows nothing about the passing of time.

The normal way to do this is to use cron to invoke a script that will
insert the row.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Seeing then that all these things shall be dissolved,
      what manner of persons ought ye to be? You ought to
      live holy and godly lives as you look forward to the
      day of God and speed its coming."
                                II Peter 3:11,12