I'm trying to implement a daemon that gets its data from postgresql.
The user uses a web interface to store the time that the daemon should begin
operations in a table called translog.
The schema for translog is as follows:
CREATE TABLE translog (
id serial,
action integer,
sdate varchar(16) NOT NULL,
stime varchar(16) NOT NULL
);
id | action | sdate | stime
----+--------+------------+----------
3 | 1 | 2004/12/10 | 12:30:00
4 | 1 | 2004/12/10 | 12:20:00
5 | 1 | 2004/12/13 | 12:30:00
6 | 1 | 2004/12/13 | 12:30:30
(4 rows)
The daemon hits the database every minute and I would like it to get all the
rows whose stime is between now and one minute ago.
How do I select all the rows that have an stime between now and one minute
ago?
- Martin -