Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Strange interval arithmetic


  • From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
  • To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
  • Subject: Strange interval arithmetic
  • Date: Sun, 27 Nov 2005 23:15:04 +0800
  • Message-id: <4389CD78(dot)4060504(at)familyhealth(dot)com(dot)au>

What's going on here?  Some sort of integer wraparound?

WORKS
=====

mysql=# select interval '2378 seconds';
 interval
----------
 00:39:38
(1 row)

mysql=#
mysql=# select 2378 * interval '1 second';
 ?column?
----------
 00:39:38
(1 row)

DOESN'T WORK
============

test=# select interval '2378234234 seconds';
   interval
--------------
 596523:14:07
(1 row)

test=# select 2378234234 * interval '1 second';
   ?column?
--------------
 660620:37:14
(1 row)




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group