Skip to content

Commit ffc703a

Browse files
committed
Fix timestamp range subdiff functions, when using float datetimes.
1 parent f62be40 commit ffc703a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/rangetypes.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ tsrange_subdiff(PG_FUNCTION_ARGS)
13131313
#ifdef HAVE_INT64_TIMESTAMP
13141314
result = ((float8)(v1-v2)) / USECS_PER_SEC;
13151315
#else
1316-
result = timestamp;
1316+
result = v1 - v2;
13171317
#endif
13181318

13191319
PG_RETURN_FLOAT8(result);
@@ -1329,7 +1329,7 @@ tstzrange_subdiff(PG_FUNCTION_ARGS)
13291329
#ifdef HAVE_INT64_TIMESTAMP
13301330
result = ((float8)(v1-v2)) / USECS_PER_SEC;
13311331
#else
1332-
result = timestamp;
1332+
result = v1 - v2;
13331333
#endif
13341334

13351335
PG_RETURN_FLOAT8(result);

0 commit comments

Comments
 (0)