Issue in Behavior of Interval Datatype

From: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
To: "'PG Hackers'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Issue in Behavior of Interval Datatype
Date: 2012-08-02 13:08:31
Message-ID: 003201cd70af$eaf058a0$c0d109e0$@kapila@huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

select (interval '56:48' minute to second);
result:00:56:48
select (interval '-56:48' minute to second);
result:-56:48:00
select (interval '+56:48' minute to second);
result:56:48:00

When user uses ‘+’ or ‘-‘ symbol, then minute to second range is getting
ignored.

I have checked the code and found that in function DecodeInterval(), for
timezone case (DTK_TZ) it uses INTERVAL_FULL_RANGE irrespective of range
passed by user.

However if use the range passed as argument in function DecodeInterval(),
the result of using ‘+’ or ‘-‘ is same as without using it.

Is there any particular reason for ignoring the range for DTK_TZ case in
DecodeInterval() function?

With Regards,

Amit Kapila

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-08-02 14:25:37 Reminder: 9.2beta3 wraps tonight
Previous Message Amit Kapila 2012-08-02 11:15:15 Re: Help me develop new commit_delay advice