Fix interval division and multiplication, before:

Bruce Momjian <bruce@momjian.us>

Commit: 826604f9e61c233c4229a3eb4d1ee3945691ee1b
Author: Bruce Momjian <bruce@momjian.us>
Date: 2005-07-20T03:50:24Z
Releases: 8.1.0
Fix interval division and multiplication, before:

	test=> select '4 months'::interval / 5;
	   ?column?
	---------------
	 1 mon -6 days
	(1 row)

after:

	test=> select '4 months'::interval / 5;
	 ?column?
	----------
	 24 days
	(1 row)

The problem was the use of rint() to round, and then find the remainder,
causing the negative values.

Files

PathChange+/−
src/backend/utils/adt/timestamp.c modified +3 −3