Re: timestamps - Mailing list pgsql-novice

From Martin Atukunda
Subject Re: timestamps
Date
Msg-id 200412150118.03979.matlads@myrealbox.com
Whole thread Raw
In response to Re: timestamps  (Steven Klassen <sklassen@commandprompt.com>)
List pgsql-novice
On Tuesday 14 December 2004 19:35, Steven Klassen wrote:
> # The schema for translog is as follows:
> #
> # CREATE TABLE translog (
> #  id serial,
> #  action integer,
> #  sdate varchar(16) NOT NULL,
> #  stime varchar(16) NOT NULL
> # );
>
> I assume you mean the composite sdate/stime is 1 minute ago?
>
> Instead of storing separate date & time varchar fields, why don't you
> store one timestamp field?  Then a query like this would work:
>
> SELECT * FROM translog WHERE start <= (now() - '1 minute'::interval);
Thanx this works!

- Martin -

pgsql-novice by date:

Previous
From: sarlav kumar
Date:
Subject: Query Optimization
Next
From: "Keith Worthington"
Date:
Subject: status variables