agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFrom: Sebastien FLAESCH <sf@4js.com>
To: Ron Mayer <rm_pg@cheapcomplexdevices.com>
Cc: pgsql-general@postgresql.org
Cc: mmoncure@gmail.com
Subject: Re: INTERVAL SECOND limited to 59 seconds?
Date: Mon, 08 Jun 2009 09:20:29 +0200
Message-ID: <4A2CBBBD.6010703@4js.com> (raw)
In-Reply-To: <4A2C0E02.9070908@cheapcomplexdevices.com>
References: <4A127038.3010103@4js.com>
<4A2C0E02.9070908@cheapcomplexdevices.com>
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)
>
view thread (11+ messages) latest in thread
Message-ID: <4A2CBBBD.6010703@4js.com>
Permalink: ../../4A2CBBBD.6010703@4js.com/
Also on: postgresql.org/message-id/4A2CBBBD.6010703@4js.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: sf@4js.com, rm_pg@cheapcomplexdevices.com, pgsql-general@postgresql.org, mmoncure@gmail.com
Subject: Re: INTERVAL SECOND limited to 59 seconds?
In-Reply-To: <4A2CBBBD.6010703@4js.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox