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

Started by Jean-Christian Imbeaultover 23 years ago3 messagesgeneral
Jump to latest
#1Jean-Christian Imbeault
jc@mega-bucks.co.jp

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

#2dima
_pppp@mail.ru
In reply to: Jean-Christian Imbeault (#1)
Re: Triggers: How to make one that fires at a certain time

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"...

#3Oliver Elphick
olly@lfix.co.uk
In reply to: Jean-Christian Imbeault (#1)
Re: Triggers: How to make one that fires at a certain

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