Re: using dates in pgsql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
Cc: PgSQL Novice ML <pgsql-novice(at)postgresql(dot)org>
Subject: Re: using dates in pgsql
Date: 2003-08-28 13:41:13
Message-ID: 11123.1062078073@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net> writes:
> On Wed, 2003-08-27 at 23:28, Tom Lane wrote:
>> WHERE activedate < (CURRENT_DATE - 188)

> How does pg know that that's 188 days, and not months or years?

<shrug> ... that's what the "date - integer" operator is defined to do.
If you want some other behavior, create another operator.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ron Johnson 2003-08-28 14:13:36 Re: using dates in pgsql
Previous Message Stuart Woodward 2003-08-28 10:10:09 From which version was DROP ... CASCADE supported?