Re: timestamp calculations

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Steve Leibel <stevel(at)bluetuna(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: timestamp calculations
Date: 2001-01-26 00:05:56
Message-ID: Pine.BSF.4.21.0101251604001.86836-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general pgsql-hackers


Assuming adddate does what seems obvious, you should just be able to add
intervals to timestamps

... last_login + '30 minutes' > now()

On Thu, 25 Jan 2001, Steve Leibel wrote:

> Hello,
>
> I'm converting a mysql db to postgres and ran into this line of code:
>
> $SQL = "select username from users where user_id = ? AND session = ?
> AND ADDDATE(last_login, INTERVAL 30 MINUTE)>CURRENT_TIMESTAMP()
>
> How do I implement adddate to get this kind of funcionality?

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tomaz Borstnar 2001-01-26 00:12:00 option to log just queries with some error - pgsql 7.1
Previous Message eriko 2001-01-25 23:59:57 Problem with index

Browse pgsql-general by date

  From Date Subject
Next Message Tomaz Borstnar 2001-01-26 00:12:00 option to log just queries with some error - pgsql 7.1
Previous Message eriko 2001-01-25 23:56:37 Problem with index

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomaz Borstnar 2001-01-26 00:12:00 option to log just queries with some error - pgsql 7.1
Previous Message Steve Leibel 2001-01-25 23:14:58 timestamp calculations