porting time calcs to PG - Mailing list pgsql-general

From greg@bryantrecording.com
Subject porting time calcs to PG
Date
Msg-id 20061207164435.9e7bc6c5a28434177d7b431073d619b9.3aae6248a6.wbe@email.secureserver.net
Whole thread Raw
Responses Re: porting time calcs to PG  (Bricklen Anderson <banderson@presinet.com>)
Re: porting time calcs to PG  (Andrew Sullivan <ajs@crankycanuck.ca>)
List pgsql-general

I'm trying to port an MS statement that's a bit involved with
timestamps, and I don't see anything in the docs to lead me forward.
It's basically a select statement, looking for records with a timestamp
within a certain range, where that range is calculated with one of the
fields.  The WHERE clause that I use in SQL Server is:
getdate() + ((2100 + 5 + (9*Points)) / 86400) >= DueTime

Where the numbers are actually parameters passed in to the function.
Other than changine getdate() to now(), I'm not sure how to change the
+ interval to be effective.  All the docs I see use something like
interval '1 hour' - not sure how to put a calculated value in the
quotes.  Is this possible?


pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Online index builds
Next
From: Tom Lane
Date:
Subject: Re: Online index builds