subtratcing dates - Mailing list pgsql-general

From Fran Fabrizio
Subject subtratcing dates
Date
Msg-id 3AF32443.CB2E50FE@exchange.webmd.net
Whole thread Raw
Responses Re: subtratcing dates  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hello all,

I have a table that has two columns, tstamp of type timestamp, and limit
of type int.

I want to have a query that tells me whether or not the timestamp is
within 'limit' minutes of the current time.

so, something like:

select tstamp > now() + '-60 minute' from log;

except i need the 60 to be the value of the 'limit' column instead so...

select tstamp > now() + '-limit minute' from log;

which of course doesn't work.  I can't seem to get it right no matter
what I try.  Any ideas?  Thanks!

-Fran


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: commit_delay CANCEL
Next
From: Stephan Szabo
Date:
Subject: Re: delete with cascade