timestamps

From: Martin Atukunda <matlads(at)myrealbox(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: timestamps
Date: 2004-12-14 09:39:44
Message-ID: 200412141239.44301.matlads@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


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 -

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Andreas Kretschmer 2004-12-14 10:15:38 Re: [despammed] timestamps
Previous Message Deepa K 2004-12-14 05:41:07 Changing debug levels in postgresql