Skip to content

Commit 41841b6

Browse files
committed
Remove useless function from regression tests
The temporary function `cagg_get_bucket_function` was created to be used in the update script for 2.14.2 to 2.15.0 and for some regression tests, but in 2.16.0 (#7042) we added a new persistent function `cagg_get_bucket_function_info` as a replacement so used it instead. Leftover from #7042 refactoring PR.
1 parent 4f824ec commit 41841b6

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed

tsl/src/continuous_aggs/utils.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,9 @@ cagg_get_bucket_function_datum(int32 mat_hypertable_id, FunctionCallInfo fcinfo)
916916
/*
917917
* This function returns the `time_bucket` function Oid in the user view definition
918918
* of a given materialization hupertable.
919+
*
920+
* NOTE: this function is deprecated and should be removed in the future, use
921+
* `cagg_get_bucket_function_info` instead.
919922
*/
920923
Datum
921924
continuous_agg_get_bucket_function(PG_FUNCTION_ARGS)

tsl/test/expected/cagg_utils.out

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,6 @@ SELECT * FROM cagg_validate_query($$ SELECT time_bucket('1 year', bucket) AS buc
259259
--
260260
-- Test bucket Oid recovery
261261
--
262-
\c :TEST_DBNAME :ROLE_SUPERUSER
263-
CREATE OR REPLACE FUNCTION cagg_get_bucket_function(
264-
mat_hypertable_id INTEGER
265-
) RETURNS regprocedure AS :MODULE_PATHNAME, 'ts_continuous_agg_get_bucket_function' LANGUAGE C STRICT VOLATILE;
266-
\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
267262
SET timezone TO PST8PDT;
268263
CREATE TABLE timestamp_ht (
269264
time timestamp NOT NULL,
@@ -352,12 +347,12 @@ CREATE MATERIALIZED VIEW integer_ht_cagg_offset
352347
GROUP BY bucket, a;
353348
NOTICE: continuous aggregate "integer_ht_cagg_offset" is already up-to-date
354349
-- Get the bucket Oids
355-
SELECT user_view_name, cagg_get_bucket_function(mat_hypertable_id)
356-
FROM _timescaledb_catalog.continuous_agg
350+
SELECT user_view_name, bf.bucket_func
351+
FROM _timescaledb_catalog.continuous_agg, LATERAL _timescaledb_functions.cagg_get_bucket_function_info(mat_hypertable_id) AS bf
357352
WHERE user_view_name IN
358353
('temperature_4h', 'temperature_tz_4h', 'temperature_tz_4h_ts', 'temperature_tz_4h_ts_origin', 'temperature_tz_4h_ts_offset', 'integer_ht_cagg', 'integer_ht_cagg_offset')
359354
ORDER BY user_view_name;
360-
user_view_name | cagg_get_bucket_function
355+
user_view_name | bucket_func
361356
-----------------------------+---------------------------------------------------------------------------------------
362357
integer_ht_cagg | time_bucket(integer,integer)
363358
integer_ht_cagg_offset | time_bucket(integer,integer,integer)
@@ -435,4 +430,3 @@ ORDER BY user_view_name;
435430
temperature_tz_4h_3 | time_bucket(interval,timestamp with time zone)
436431
(1 row)
437432

438-
DROP FUNCTION IF EXISTS cagg_get_bucket_function(INTEGER);

tsl/test/sql/cagg_utils.sql

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,6 @@ SELECT * FROM cagg_validate_query($$ SELECT time_bucket('1 year', bucket) AS buc
108108
-- Test bucket Oid recovery
109109
--
110110

111-
\c :TEST_DBNAME :ROLE_SUPERUSER
112-
CREATE OR REPLACE FUNCTION cagg_get_bucket_function(
113-
mat_hypertable_id INTEGER
114-
) RETURNS regprocedure AS :MODULE_PATHNAME, 'ts_continuous_agg_get_bucket_function' LANGUAGE C STRICT VOLATILE;
115-
\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
116-
117111
SET timezone TO PST8PDT;
118112

119113
CREATE TABLE timestamp_ht (
@@ -189,8 +183,8 @@ CREATE MATERIALIZED VIEW integer_ht_cagg_offset
189183
GROUP BY bucket, a;
190184

191185
-- Get the bucket Oids
192-
SELECT user_view_name, cagg_get_bucket_function(mat_hypertable_id)
193-
FROM _timescaledb_catalog.continuous_agg
186+
SELECT user_view_name, bf.bucket_func
187+
FROM _timescaledb_catalog.continuous_agg, LATERAL _timescaledb_functions.cagg_get_bucket_function_info(mat_hypertable_id) AS bf
194188
WHERE user_view_name IN
195189
('temperature_4h', 'temperature_tz_4h', 'temperature_tz_4h_ts', 'temperature_tz_4h_ts_origin', 'temperature_tz_4h_ts_offset', 'integer_ht_cagg', 'integer_ht_cagg_offset')
196190
ORDER BY user_view_name;
@@ -249,5 +243,3 @@ SELECT user_view_name, bf.bucket_func
249243
FROM _timescaledb_catalog.continuous_agg, LATERAL _timescaledb_functions.cagg_get_bucket_function_info(mat_hypertable_id) AS bf
250244
WHERE user_view_name = 'temperature_tz_4h_3'
251245
ORDER BY user_view_name;
252-
253-
DROP FUNCTION IF EXISTS cagg_get_bucket_function(INTEGER);

0 commit comments

Comments
 (0)