diff options
author | Bruce Momjian <bruce@momjian.us> | 2006-03-06 22:49:17 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2006-03-06 22:49:17 +0000 |
commit | d69b163247f62895c72f5f412638e5bbf4ca858b (patch) | |
tree | 25d0cafedc22e1078ffbeaba0ae7010a10f95ca5 /src/include/utils/timestamp.h | |
parent | 19c21d115d221d9738afad142f2886dfd3cc40de (diff) |
Attached is the new patch. To summarize:
- new function justify_interval(interval)
- modified function justify_hours(interval)
- modified function justify_days(interval)
These functions are defined to meet the requirements as discussed in
this thread. Specifically:
- justify_hours makes certain the sign bit on the hours
matches the sign bit on the days. It only checks the
sign bit on the days, and not the months, when
determining if the hours should be positive or negative.
After the call, -24 < hours < 24.
- justify_days makes certain the sign bit on the days
matches the sign bit on the months. It's behavior does
not depend on the hours, nor does it modify the hours.
After the call, -30 < days < 30.
- justify_interval makes sure the sign bits on all three
fields months, days, and hours are all the same. After
the call, -24 < hours < 24 AND -30 < days < 30.
Mark Dilger
Diffstat (limited to 'src/include/utils/timestamp.h')
-rw-r--r-- | src/include/utils/timestamp.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h index 7469f40723a..9747b300b6c 100644 --- a/src/include/utils/timestamp.h +++ b/src/include/utils/timestamp.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/timestamp.h,v 1.58 2006/03/05 15:59:08 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/timestamp.h,v 1.59 2006/03/06 22:49:17 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -234,6 +234,7 @@ extern Datum interval_cmp(PG_FUNCTION_ARGS); extern Datum interval_hash(PG_FUNCTION_ARGS); extern Datum interval_smaller(PG_FUNCTION_ARGS); extern Datum interval_larger(PG_FUNCTION_ARGS); +extern Datum interval_justify_interval(PG_FUNCTION_ARGS); extern Datum interval_justify_hours(PG_FUNCTION_ARGS); extern Datum interval_justify_days(PG_FUNCTION_ARGS); |