Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 28F526328C8 for ; Tue, 9 Jun 2009 23:50:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 59653-09 for ; Tue, 9 Jun 2009 23:50:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp108.biz.mail.mud.yahoo.com (smtp108.biz.mail.mud.yahoo.com [68.142.201.177]) by mail.postgresql.org (Postfix) with SMTP id 0702B6327C4 for ; Tue, 9 Jun 2009 23:49:44 -0300 (ADT) Received: (qmail 74202 invoked from network); 10 Jun 2009 02:49:31 -0000 Received: from unknown (HELO ?192.168.5.110?) (rm_pg@76.201.140.172 with plain) by smtp108.biz.mail.mud.yahoo.com with SMTP; 10 Jun 2009 02:49:31 -0000 X-Yahoo-SMTP: acjdBE2swBAAX9ja0RY4hQi0ggqg.Ml3.omUEQJ1xZsuGIb6CRE- X-YMail-OSG: 2tHqzy0VM1mOnhF.JhSEJmwF.2K6jVtfoNI32LILU0nDq417v_toRVbqPHha7gQ0JRM248jd3WPa0hZoxDb4uW3kEso3lNqLabdwgujaYmq1FaDR1lLK1b9Zav_XsFN6TiZV4sOXxnZ4gCdzAmITwFMOysRxob3RWo9BT_FYt2CFf2M80BiDvq8oQd8vkE4NeTliv9ButhwA22w8Y.OPxiG5hpHqbidS4ly015tv9yPC8IbIlwQPBx0fQO_zJzXmvRWv974gSICDqr39_krtVLi3RpGHX46oV5.r1iyiNHtRDlQnNuokhAXTBptUz4mGZE_R_xY- X-Yahoo-Newman-Property: ymail-3 Message-ID: <4A2F1F3B.1080308@cheapcomplexdevices.com> Date: Tue, 09 Jun 2009 19:49:31 -0700 From: Ron Mayer User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: Tom Lane CC: Ron Mayer , Sebastien FLAESCH , pgsql-general@postgresql.org, mmoncure@gmail.com Subject: Re: INTERVAL SECOND limited to 59 seconds? References: <4A127038.3010103@4js.com> <4A2C0E02.9070908@cheapcomplexdevices.com> <17203.1244402910@sss.pgh.pa.us> <4A2DABF5.3070906@cheapcomplexdevices.com> <208.1244587299@sss.pgh.pa.us> <1256.1244588367@sss.pgh.pa.us> In-Reply-To: <1256.1244588367@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200906/491 X-Sequence-Number: 148835 Tom Lane wrote: > I wrote: >> I'm inclined to say that these two cases are out of line with what >> the rest of the code does and we should change them. > ... > Now, all three of these cases throw "invalid input syntax" in 8.3, > so this is not a regression from released behavior. The question > is does anyone think that these syntaxes should be valid? They're > not legal per spec, for sure, and they seem pretty ambiguous to me. Seems to do a sane thing for all sane inputs I threw at it. It still accepts one odd input that 8.3 rejected: regression=# select interval '1 1' hour; Perhaps the additional patch below fixes that? *************** *** 3022,3028 **** DecodeInterval(char **field, int *ftype, int nf, int range, tm->tm_hour += val; AdjustFractSeconds(fval, tm, fsec, SECS_PER_HOUR); tmask = DTK_M(HOUR); ! type = DTK_DAY; /* set for next field */ break; case DTK_DAY: --- 3022,3029 ---- tm->tm_hour += val; AdjustFractSeconds(fval, tm, fsec, SECS_PER_HOUR); tmask = DTK_M(HOUR); ! if (range == (INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR))) ! type = DTK_DAY; /* set for next field */ break; case DTK_DAY: It also gives different answers than 8.3 for "select interval '1 1:' hour" but I guess that's intended, right?