Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group