Thread: interval is ignored

interval is ignored

From
rodeored
Date:
SELECT INTERVAL '1' MONTH = 00:00:00
 Therefore now=onemonthago
SELECT NOW(),NOW()- INTERVAL '1' MONTH as onemonthago

How do I get the timestamp for one month ago?

Re: interval is ignored

From
rodeored
Date:
On Jun 11, 10:14 am, rodeored <in...@reenie.org> wrote:
> SELECT INTERVAL '1' MONTH = 00:00:00
>  Therefore now=onemonthago
> SELECT NOW(),NOW()- INTERVAL '1' MONTH as onemonthago
>
> How do I get the timestamp for one month ago?

Never mind,

its
SELECT NOW(),NOW()- INTERVAL '1 MONTH' as onemonthago

Re: interval is ignored

From
Tom Lane
Date:
rodeored <info1@reenie.org> writes:
> On Jun 11, 10:14�am, rodeored <in...@reenie.org> wrote:
>> SELECT INTERVAL '1' MONTH = 00:00:00

> Never mind,
> its
> SELECT NOW(),NOW()- INTERVAL '1 MONTH' as onemonthago

Just for completeness --- the INTERVAL '1' MONTH syntax is supported as
of 8.4.

            regards, tom lane