From: Heikki Linnakangas Date: Mon, 7 Nov 2011 15:33:31 +0000 (+0200) Subject: Fix timestamp range subdiff functions, when using float datetimes. X-Git-Tag: REL9_2_BETA1~862 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ffc703a891e336b9bf4b74112bd4684d1f990fab;p=postgresql Fix timestamp range subdiff functions, when using float datetimes. --- diff --git a/src/backend/utils/adt/rangetypes.c b/src/backend/utils/adt/rangetypes.c index 6327d33f3a..1ca6627b72 100644 --- a/src/backend/utils/adt/rangetypes.c +++ b/src/backend/utils/adt/rangetypes.c @@ -1313,7 +1313,7 @@ tsrange_subdiff(PG_FUNCTION_ARGS) #ifdef HAVE_INT64_TIMESTAMP result = ((float8)(v1-v2)) / USECS_PER_SEC; #else - result = timestamp; + result = v1 - v2; #endif PG_RETURN_FLOAT8(result); @@ -1329,7 +1329,7 @@ tstzrange_subdiff(PG_FUNCTION_ARGS) #ifdef HAVE_INT64_TIMESTAMP result = ((float8)(v1-v2)) / USECS_PER_SEC; #else - result = timestamp; + result = v1 - v2; #endif PG_RETURN_FLOAT8(result);