Tom Lane <tgl@sss.pgh.pa.us> writes:
> Tilo Schwarz <mail@tilo-schwarz.de> writes:
>> tschwarz=> select '-0.1'::interval;
>> interval
>> -------------
>> 00:00:00.10 <---
>> (1 row)
> This is incontestably a bug. Will fix for 7.4.1.
I've applied the attached patch to 7.4 and HEAD. It'd probably work in
7.3 as well, but I didn't look.
regards, tom lane
*** src/backend/utils/adt/datetime.c.orig Sat Nov 29 14:51:58 2003
--- src/backend/utils/adt/datetime.c Wed Dec 17 16:33:25 2003
***************
*** 3005,3011 **** if (*cp != '\0') return DTERR_BAD_FORMAT;
! if (val < 0) fval = -(fval); } else if
(*cp== '\0')
--- 3005,3011 ---- if (*cp != '\0') return DTERR_BAD_FORMAT;
! if (*field[i] == '-') fval = -(fval); }
elseif (*cp == '\0')