Skip to content

Commit

Permalink
Load icu extension by default (#512)
Browse files Browse the repository at this point in the history
Fixes comparisons/operators of the `timestamp with timezone` type.

Fixes #490
  • Loading branch information
ritwizsinha authored Jan 2, 2025
1 parent 6941855 commit 1a68605
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/regression/expected/extensions.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ SET duckdb.force_execution TO false;
SELECT * FROM duckdb.raw_query($$ SELECT extension_name, loaded, installed FROM duckdb_extensions() WHERE loaded and extension_name != 'jemalloc' $$);
NOTICE: result: extension_name loaded installed
VARCHAR BOOLEAN BOOLEAN
[ Rows: 4]
[ Rows: 5]
cached_httpfs true true
icu true true
json true true
parquet true true
pgduckdb true false
Expand Down
12 changes: 12 additions & 0 deletions test/regression/expected/timestamp_with_interval.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE TABLE recently_created_table(a VARCHAR);
INSERT INTO recently_created_table VALUES ('latest 1'), ('latest 2'), ('latest 3');
select 1 as result
FROM recently_created_table
WHERE timestamp with time zone '2024-12-10 13:59:59.776896+00' < CAST((NOW() + INTERVAL '1 day') AS date)
LIMIT 1;
result
--------
1
(1 row)

drop table recently_created_table;
1 change: 1 addition & 0 deletions test/regression/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ test: transaction_errors
test: secrets
test: prepare
test: function
test: timestamp_with_interval
test: approx_count_distinct
9 changes: 9 additions & 0 deletions test/regression/sql/timestamp_with_interval.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE recently_created_table(a VARCHAR);
INSERT INTO recently_created_table VALUES ('latest 1'), ('latest 2'), ('latest 3');

select 1 as result
FROM recently_created_table
WHERE timestamp with time zone '2024-12-10 13:59:59.776896+00' < CAST((NOW() + INTERVAL '1 day') AS date)
LIMIT 1;

drop table recently_created_table;
1 change: 1 addition & 0 deletions third_party/pg_duckdb_extensions.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
duckdb_extension_load(json)
duckdb_extension_load(icu)
# This is relative to third_party/duckdb dir
duckdb_extension_load(cached_httpfs
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../cached_httpfs"
Expand Down

0 comments on commit 1a68605

Please sign in to comment.