We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 70a33b2 commit b538c90Copy full SHA for b538c90
src/backend/utils/adt/rangetypes.c
@@ -1431,13 +1431,15 @@ daterange_canonical(PG_FUNCTION_ARGS)
1431
if (empty)
1432
PG_RETURN_RANGE_P(r);
1433
1434
- if (!lower.infinite && !DATE_NOT_FINITE(lower.val) && !lower.inclusive)
+ if (!lower.infinite && !DATE_NOT_FINITE(DatumGetDateADT(lower.val)) &&
1435
+ !lower.inclusive)
1436
{
1437
lower.val = DirectFunctionCall2(date_pli, lower.val, Int32GetDatum(1));
1438
lower.inclusive = true;
1439
}
1440
- if (!upper.infinite && !DATE_NOT_FINITE(upper.val) && upper.inclusive)
1441
+ if (!upper.infinite && !DATE_NOT_FINITE(DatumGetDateADT(upper.val)) &&
1442
+ upper.inclusive)
1443
1444
upper.val = DirectFunctionCall2(date_pli, upper.val, Int32GetDatum(1));
1445
upper.inclusive = false;
0 commit comments