Skip to content

Commit

Permalink
Merge pull request #11987 from hawkfish/date-to-tstz
Browse files Browse the repository at this point in the history
Issue #11959: TIMESTAMPTZ >= DATE
  • Loading branch information
Mytherin committed May 13, 2024
2 parents e6b9864 + 354863e commit 7102294
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/function/cast_rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ static int64_t ImplicitCastUhugeint(const LogicalType &to) {
static int64_t ImplicitCastDate(const LogicalType &to) {
switch (to.id()) {
case LogicalTypeId::TIMESTAMP:
case LogicalTypeId::TIMESTAMP_TZ:
return TargetTypeCost(to);
default:
return -1;
Expand Down
8 changes: 8 additions & 0 deletions test/sql/function/timestamp/test_icu_datetrunc.test
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,11 @@ select date_trunc('minute', '2022-10-30 02:17:00+02'::TIMESTAMPTZ);
----
2022-10-30 02:17:00+02

# Comparisons to DATE
statement ok
set time zone 'UTC';

query I
select date_trunc('day', '2024-05-06 16:09:28+05:00'::timestamptz) >= '2024-05-06 17:19:18+05:20'::date as r
----
True

0 comments on commit 7102294

Please sign in to comment.