BUG #4918: Weird input syntax for intervals
The following bug has been logged online:
Bug reference: 4918
Logged by: Frank Spies
Email address: frank.spies@biotronik.com
PostgreSQL version: 8.4
Operating system: Linux
Description: Weird input syntax for intervals
Details:
It feels totally weird that the two queries
1) select interval '13 month'
2) select interval '13' month
do not have the same result: result for 1) is "1 year 1 mon", result for 2
is "1 mon". Is this correct behaviour?
"Frank Spies" <frank.spies@biotronik.com> writes:
It feels totally weird that the two queries
1) select interval '13 month'
2) select interval '13' month
do not have the same result: result for 1) is "1 year 1 mon", result for 2
is "1 mon". Is this correct behaviour?
$ psql
psql (8.4.0)
Type "help" for help.
regression=# select interval '13 month';
interval
--------------
1 year 1 mon
(1 row)
regression=# select interval '13' month;
interval
--------------
1 year 1 mon
(1 row)
You sure you are on 8.4.0? We were fooling with the interval input code
quite late in 8.4 beta.
regards, tom lane
Hi Tom,
you are right, it's an RC I was running on.
Sorry...
Frank
www.biotronik.com
BIOTRONIK GmbH & Co. KG
Woermannkehre 1, 12359 Berlin, Germany
Sitz der Gesellschaft: Berlin, Registergericht: Berlin HRA 6501
Vertreten durch ihre Komplementärin:
BIOTRONIK Mess- und Therapiegeräte GmbH
Sitz der Gesellschaft: Berlin, Registergericht: Berlin HRB 2918
Geschäftsführer: Dr. Max Schaldach, Christoph Böhmer, Dr. Werner Braun,
Dr. Lothar Krings
This email and the information it contains including attachments are
confidential and meant only for use by the intended recipient(s);
disclosure or copying is strictly prohibited. If you are not addressed,
but in the possession of this email, please notify the sender immediately
and delete the document.
Hi,
I played a bit with the interval syntax and found this, this time on a 8.4
release:
psql -ddb_frank
psql (8.4.0)
Type "help" for help.
db_frank=# select interval '2.5' year;
interval
----------
2 years
(1 row)
db_frank=# select interval '2.5 year';
interval
----------------
2 years 6 mons
(1 row)
db_frank=# select version();
version
-------------------------------------------------------------------------------------------------------------
PostgreSQL 8.4.0 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.3.real
(Ubuntu 4.3.3-5ubuntu4) 4.3.3, 64-bit
(1 row)
www.biotronik.com
BIOTRONIK GmbH & Co. KG
Woermannkehre 1, 12359 Berlin, Germany
Sitz der Gesellschaft: Berlin, Registergericht: Berlin HRA 6501
Vertreten durch ihre Komplementärin:
BIOTRONIK Mess- und Therapiegeräte GmbH
Sitz der Gesellschaft: Berlin, Registergericht: Berlin HRB 2918
Geschäftsführer: Dr. Max Schaldach, Christoph Böhmer, Dr. Werner Braun,
Dr. Lothar Krings
This email and the information it contains including attachments are
confidential and meant only for use by the intended recipient(s);
disclosure or copying is strictly prohibited. If you are not addressed,
but in the possession of this email, please notify the sender immediately
and delete the document.