timestamps - Mailing list pgsql-novice

From Martin Atukunda
Subject timestamps
Date
Msg-id 200412141239.44301.matlads@myrealbox.com
Whole thread Raw
Responses Re: [despammed] timestamps
Re: timestamps
List 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 -

pgsql-novice by date:

Previous
From: "Deepa K"
Date:
Subject: Changing debug levels in postgresql
Next
From: Andreas Kretschmer
Date:
Subject: Re: [despammed] timestamps