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

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Triggers: How to make one that fires at a certain
Date: 2002-08-26 13:50:27
Message-ID: 1030369827.22995.19.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)Elphick(at)lfix(dot)co(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Ray 2002-08-26 14:01:25 Permissions for system tables
Previous Message Marc G. Fournier 2002-08-26 13:43:53 Re: [GENERAL] PostgreSQL 7.2.2: Security Release