From ae7a73abb0167f6aec316d905834f86dc1a71d11 Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Wed, 24 Apr 2024 10:34:22 +0200 Subject: [PATCH] Change error message for disabled feature flags This intentionally doesnt follow the postgres guidelines for message and detail because by default users won't see the detail and we want to present a clear message without requiring enabling additional verbosity. --- src/guc.c | 4 +-- tsl/test/expected/feature_flags.out | 38 ++++++++++++++--------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/guc.c b/src/guc.c index 7d6406c9b..547da7fb8 100644 --- a/src/guc.c +++ b/src/guc.c @@ -178,8 +178,8 @@ ts_feature_flag_check(FeatureFlagType type) return; ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("this feature is disabled"), - errdetail("Feature flag \"%s\" is off", flag->name))); + errmsg("You are using a Dynamic PostgreSQL service. This feature is only available on " + "Time-series services. https://tsdb.co/dynamic-postgresql"))); } /* diff --git a/tsl/test/expected/feature_flags.out b/tsl/test/expected/feature_flags.out index 9fdef190c..483fc9247 100644 --- a/tsl/test/expected/feature_flags.out +++ b/tsl/test/expected/feature_flags.out @@ -13,7 +13,7 @@ SET timescaledb.enable_hypertable_create TO off; CREATE TABLE test(time timestamptz, device int); \set ON_ERROR_STOP 0 SELECT * FROM create_hypertable('test', 'time'); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql \set ON_ERROR_STOP 1 SET timescaledb.enable_hypertable_create TO on; SELECT * FROM create_hypertable('test', 'time'); @@ -42,7 +42,7 @@ SELECT * FROM show_chunks('test'); -- compress_chunk \set ON_ERROR_STOP 0 SELECT compress_chunk('_timescaledb_internal._hyper_1_1_chunk'); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql \set ON_ERROR_STOP 1 SET timescaledb.enable_hypertable_compression TO on; -- ensure compression cannot be enabled @@ -67,14 +67,14 @@ SET timescaledb.enable_hypertable_compression TO off; -- cannot alter compressed table \set ON_ERROR_STOP 0 ALTER TABLE test ADD COLUMN col1 boolean DEFAULT false NOT NULL; -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql \set ON_ERROR_STOP 1 SET timescaledb.enable_hypertable_compression TO on; ALTER TABLE test ADD COLUMN col1 boolean DEFAULT false NOT NULL; SET timescaledb.enable_hypertable_compression TO off; \set ON_ERROR_STOP 0 ALTER TABLE test DROP COLUMN col1; -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql \set ON_ERROR_STOP 1 -- cagg creation SHOW timescaledb.enable_cagg_create; @@ -93,7 +93,7 @@ SELECT FROM test GROUP BY hour, device; -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql \set ON_ERROR_STOP 1 SET timescaledb.enable_cagg_create TO on; CREATE MATERIALIZED VIEW contagg @@ -108,7 +108,7 @@ NOTICE: refreshing continuous aggregate "contagg" SET timescaledb.enable_cagg_create TO off; \set ON_ERROR_STOP 0 CALL refresh_continuous_aggregate('contagg', NULL, NULL); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql \set ON_ERROR_STOP 1 SET timescaledb.enable_cagg_create TO on; -- policy creation @@ -121,30 +121,30 @@ SHOW timescaledb.enable_policy_create; SET timescaledb.enable_policy_create TO off; \set ON_ERROR_STOP 0 select add_retention_policy('test', INTERVAL '4 months', true); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql select remove_retention_policy('test'); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql select add_compression_policy('test', compress_after => NULL); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql SELECT remove_compression_policy('test'); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql SELECT add_continuous_aggregate_policy('contagg', '1 day'::interval, 10 , '1 h'::interval); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql SELECT remove_continuous_aggregate_policy('contagg'); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql CREATE INDEX idx ON test(device); SELECT add_reorder_policy('test', 'idx'); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql select remove_reorder_policy('test'); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql SELECT timescaledb_experimental.add_policies('test', refresh_start_offset => 1, refresh_end_offset => 10, compress_after => 11, drop_after => 20); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql SELECT timescaledb_experimental.show_policies('test'); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql SELECT timescaledb_experimental.alter_policies('test', refresh_start_offset => 11, compress_after=>13, drop_after => 25); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql SELECT timescaledb_experimental.remove_all_policies('test'); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql SELECT timescaledb_experimental.remove_policies('test', false, 'policy_refresh_continuous_aggregate', 'policy_compression'); -ERROR: this feature is disabled +ERROR: You are using a Dynamic PostgreSQL service. This feature is only available on Time-series services. https://tsdb.co/dynamic-postgresql \set ON_ERROR_STOP 1