Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 8C760633537 for ; Mon, 8 Jun 2009 04:20:25 -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 30258-04 for ; Mon, 8 Jun 2009 04:20:24 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail2007.strasbourg.4js.com (mail2007.strasbourg.4js.com [84.14.60.197]) by mail.postgresql.org (Postfix) with ESMTP id D34936332E5 for ; Mon, 8 Jun 2009 04:20:20 -0300 (ADT) Received: from fox.strasbourg.4js.com (fox.strasbourg.4js.com [10.0.0.196]) (authenticated bits=0) by mail2007.strasbourg.4js.com (8.13.8/8.13.8/Debian-3) with ESMTP id n587JtOj017968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 8 Jun 2009 09:19:58 +0200 Message-ID: <4A2CBBBD.6010703@4js.com> Date: Mon, 08 Jun 2009 09:20:29 +0200 From: Sebastien FLAESCH Organization: Four J's Development Tools User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: Ron Mayer CC: pgsql-general@postgresql.org, mmoncure@gmail.com Subject: Re: INTERVAL SECOND limited to 59 seconds? References: <4A127038.3010103@4js.com> <4A2C0E02.9070908@cheapcomplexdevices.com> In-Reply-To: <4A2C0E02.9070908@cheapcomplexdevices.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.94/9436/Mon Jun 8 02:21:18 2009 on mail2007.strasbourg.4js.com X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (mail2007.strasbourg.4js.com [10.10.0.1]); Mon, 08 Jun 2009 09:20:03 +0200 (CEST) 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/372 X-Sequence-Number: 148716 This is of course unexpected to me (one day becomes an hour)... Actually I would even expect an error, because there are missing interval parts. To represent a valid day to second interval, you should write '1 00:00:00' ... '1' would be a valid day to day interval. Always providing all interval units would clarify the user code (avoid complex rules to get defaults), IMHO. Just to compare with IFX interval literals: ============================================================================== > select interval( 1, day to second ) from systables where tabid=1; 201: A syntax error has occurred. Error in line 1 Near character position 37 > select interval( 1 ) day to second from systables where tabid=1; 1262: Non-numeric character in datetime or interval. Error in line 1 Near character position 36 > select interval ( 1 11:22:33 ) day to second from systables where tabid=1; (constant) 1 11:22:33 1 row(s) retrieved. > select interval ( 1 ) day to day from systables where tabid=1; (constant) 1 1 row(s) retrieved. ============================================================================== Seb Ron Mayer wrote: > Finally got around to looking at this thread. > Looks like the original questions from the thread > got resolved, but I found this behaviour surprising: > > regression=# select interval '1' day to second; > interval > ---------- > @ 1 hour > (1 row) > > Should this be 1 second? > If so I can send a patch. > > > > > > regression=# select version(); > version > ----------------------------------------------------------------------------------------------------------- > PostgreSQL 8.4beta2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3), 32-bit > (1 row) >