Issue in Behavior of Interval Datatype - Mailing list pgsql-hackers

From Amit Kapila
Subject Issue in Behavior of Interval Datatype
Date
Msg-id 003201cd70af$eaf058a0$c0d109e0$@kapila@huawei.com
Whole thread Raw
Responses Re: Issue in Behavior of Interval Datatype
List pgsql-hackers
<div class="WordSection1"><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">select
(interval'56:48'  minute to second<b>);</b><br /><b><span style="color:#004080">result</span></b></span><b><span
style="font-size:10.0pt">:</span></b><spanstyle="font-size:10.0pt;font-family:"Arial","sans-serif"">00:56:48 <br
/>select(interval '-56:48'  minute to second); <br /><b><span style="color:#004080">result</span></b></span><span
style="font-size:10.0pt">:</span><spanstyle="font-size:10.0pt;font-family:"Arial","sans-serif"">-56:48:00 <br />select
(interval'+56:48'  minute to second); <br /><b><span style="color:#004080">result</span></b></span><span
style="font-size:10.0pt">:</span><spanstyle="font-size:10.0pt;font-family:"Arial","sans-serif"">56:48:00</span><p
class="MsoNormal"><spanstyle="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Whenuser uses ‘+’ or ‘–‘ symbol, then minute to second range
isgetting ignored.</span><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><pclass="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Ihave 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.</span><p
class="MsoNormal"><spanstyle="font-size:10.0pt;font-family:"Arial","sans-serif"">However if use the range passed as
argumentin function DecodeInterval(), the result of using ‘+’ or ‘-‘ is same as without using it.</span><p
class="MsoNormal"><spanstyle="font-size:10.0pt;font-family:"Arial","sans-serif"">Is there any particular reason for
ignoringthe range for DTK_TZ case in DecodeInterval() function?</span><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><pclass="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><pclass="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">WithRegards,</span><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">AmitKapila</span><p class="MsoNormal"> </div> 

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Help me develop new commit_delay advice
Next
From: Tom Lane
Date:
Subject: Reminder: 9.2beta3 wraps tonight