Timestamps

From: Slavisa Garic <Slavisa(dot)Garic(at)infotech(dot)monash(dot)edu(dot)au>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Timestamps
Date: 2004-02-09 06:34:37
Message-ID: Pine.GSO.4.10.10402091729010.29934-100000@bruce.csse.monash.edu.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

I am not sure if this should be sent to this mailing list. If i am wrong
could someone please direct me to the correct one so I can subscribe
there.

I wanted to ask a simple question. Say I have a table with the timestamp
field. What is the best way to say get all the records that were created
say 2 hours before the query. One of the options would be to generate the
timestamp in the correct format and then send a query in the format
SELECT * from <table> where create_time < <generated_timestamp>

Is there a better way than this?

Any help would be greatly appreciated,
Regards,
Slavisa

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-02-09 06:35:54 Re: psql variables
Previous Message Tom Lane 2004-02-09 06:25:10 Re: [HACKERS] dollar quoting