aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/timestamp.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 8593b6b47f4..2adc178de4f 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -3710,10 +3710,17 @@ interval_trunc(PG_FUNCTION_ARGS)
break;
default:
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("interval units \"%s\" not supported",
- lowunits)));
+ if (val == DTK_WEEK)
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("interval units \"%s\" not supported "
+ "because months usually have fractional weeks",
+ lowunits)));
+ else
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("interval units \"%s\" not supported",
+ lowunits)));
}
if (tm2interval(tm, fsec, result) != 0)