Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .unreleased/pr_8786
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implements: #8786 Display chunks view range as timestamps for UUIDv7
2 changes: 1 addition & 1 deletion sql/updates/latest-dev.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

DROP FUNCTION IF EXISTS _timescaledb_functions.policy_job_stat_history_retention;
DROP VIEW IF EXISTS timescaledb_information.chunks;

3 changes: 1 addition & 2 deletions sql/updates/reverse-dev.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@

DROP FUNCTION IF EXISTS _timescaledb_functions.policy_job_stat_history_retention;

DROP VIEW IF EXISTS timescaledb_information.chunks;
8 changes: 4 additions & 4 deletions sql/views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -178,22 +178,22 @@ FROM (
dim.column_name AS primary_dimension,
dim.column_type AS primary_dimension_type,
row_number() OVER (PARTITION BY chcons.chunk_id ORDER BY dim.id) AS chunk_dimension_num,
CASE WHEN dim.column_type = ANY(ARRAY['timestamp','timestamptz','date']::regtype[]) THEN
CASE WHEN dim.column_type = ANY(ARRAY['timestamp','timestamptz','date', 'uuid']::regtype[]) THEN
_timescaledb_functions.to_timestamp(dimsl.range_start)
ELSE
NULL
END AS range_start,
CASE WHEN dim.column_type = ANY(ARRAY['timestamp','timestamptz','date']::regtype[]) THEN
CASE WHEN dim.column_type = ANY(ARRAY['timestamp','timestamptz','date', 'uuid']::regtype[]) THEN
_timescaledb_functions.to_timestamp(dimsl.range_end)
ELSE
NULL
END AS range_end,
CASE WHEN dim.column_type = ANY(ARRAY['timestamp','timestamptz','date']::regtype[]) THEN
CASE WHEN dim.column_type = ANY(ARRAY['timestamp','timestamptz','date', 'uuid']::regtype[]) THEN
NULL
ELSE
dimsl.range_start
END AS integer_range_start,
CASE WHEN dim.column_type = ANY(ARRAY['timestamp','timestamptz','date']::regtype[]) THEN
CASE WHEN dim.column_type = ANY(ARRAY['timestamp','timestamptz','date', 'uuid']::regtype[]) THEN
NULL
ELSE
dimsl.range_end
Expand Down
4 changes: 2 additions & 2 deletions test/expected/uuid.out
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ ORDER BY id DESC;
CREATE VIEW chunk_ranges AS
SELECT
chunk_name,
_timescaledb_functions.to_timestamp(range_start_integer) AS range_start,
_timescaledb_functions.to_timestamp(range_end_integer) AS range_end
range_start,
range_end
FROM timescaledb_information.chunks
WHERE hypertable_name = 'uuid_events';
SELECT * FROM chunk_ranges;
Expand Down
4 changes: 2 additions & 2 deletions test/sql/uuid.sql
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ ORDER BY id DESC;
CREATE VIEW chunk_ranges AS
SELECT
chunk_name,
_timescaledb_functions.to_timestamp(range_start_integer) AS range_start,
_timescaledb_functions.to_timestamp(range_end_integer) AS range_end
range_start,
range_end
FROM timescaledb_information.chunks
WHERE hypertable_name = 'uuid_events';

Expand Down
Loading