Skip to content

Commit 724ff45

Browse files
committed
Add compatibility view for chunk_constraint
1 parent 61678e2 commit 724ff45

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

cmake/ScriptFiles.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ set(SOURCE_FILES
4444
uuidv7.sql
4545
ts_stats.sql
4646
views.sql
47+
views_compat.sql
4748
views_experimental.sql
4849
gapfill.sql
4950
compression.sql

sql/views.sql

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,6 @@ AS SELECT * FROM timescaledb_information.hypertable_compression_settings;
424424
CREATE OR REPLACE VIEW timescaledb_information.chunk_columnstore_settings AS
425425
SELECT * FROM timescaledb_information.chunk_compression_settings;
426426

427-
--temporary alias for bgw_job
428-
CREATE OR REPLACE VIEW _timescaledb_config.bgw_job AS
429-
SELECT * from _timescaledb_catalog.bgw_job;
430-
431427
-- chunk statistics view
432428
CREATE OR REPLACE VIEW timescaledb_information.stat_chunk_activity AS
433429
SELECT
@@ -496,6 +492,4 @@ LEFT JOIN _timescaledb_catalog.chunk c
496492
ON format('%I.%I', c.schema_name, c.table_name)::regclass = o.uncompressed_relid
497493
LEFT JOIN _timescaledb_catalog.hypertable h ON h.id = c.hypertable_id;
498494

499-
500-
GRANT SELECT ON ALL TABLES IN SCHEMA _timescaledb_config TO PUBLIC;
501495
GRANT SELECT ON ALL TABLES IN SCHEMA timescaledb_information TO PUBLIC;

sql/views_compat.sql

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-- This file and its contents are licensed under the Apache License 2.0.
2+
-- Please see the included NOTICE for copyright information and
3+
-- LICENSE-APACHE for a copy of the license.
4+
5+
-- temporary views for compatibility
6+
7+
CREATE OR REPLACE VIEW _timescaledb_config.bgw_job AS
8+
SELECT * from _timescaledb_catalog.bgw_job;
9+
10+
CREATE OR REPLACE VIEW _timescaledb_catalog.chunk_constraint AS
11+
SELECT
12+
chunk_id,
13+
id AS dimension_slice_id,
14+
format('constraint_%s',id) AS constraint_name,
15+
NULL::text AS hypertable_constraint_name from _timescaledb_catalog.dimension_slice;
16+
17+
GRANT SELECT ON ALL TABLES IN SCHEMA _timescaledb_config TO PUBLIC;
18+
GRANT SELECT ON ALL TABLES IN SCHEMA _timescaledb_catalog TO PUBLIC;

0 commit comments

Comments
 (0)