Skip to content

Commit 4e6979d

Browse files
committed
Version 4
1 parent acb7379 commit 4e6979d

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

sql/updates/reverse-dev.sql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,3 @@ FROM _timescaledb_catalog.continuous_agg, LATERAL _timescaledb_functions.cagg_ge
8686
SELECT pg_catalog.pg_extension_config_dump('_timescaledb_catalog.continuous_aggs_bucket_function', '');
8787

8888
GRANT SELECT ON _timescaledb_catalog.continuous_aggs_bucket_function TO PUBLIC;
89-
90-
DROP FUNCTION IF EXISTS _timescaledb_functions.cagg_get_bucket_function_info(INTEGER);
91-

tsl/src/continuous_aggs/utils.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ continuous_agg_migrate_to_time_bucket(PG_FUNCTION_ARGS)
596596
/* Update the time_bucket_fuction */
597597
cagg->bucket_function->bucket_function = new_bucket_function;
598598
bool origin_added_during_migration = false;
599-
TimestampTz bucket_time_origin_to_replace = 0;
599+
TimestampTz bucket_time_origin_to_replace = cagg->bucket_function->bucket_time_origin;
600600

601601
/* Set new origin if not already present in the function definition. This is needed since
602602
* time_bucket and time_bucket_ng use different origin default values.
@@ -615,6 +615,8 @@ continuous_agg_migrate_to_time_bucket(PG_FUNCTION_ARGS)
615615
bucket_time_origin_to_replace,
616616
need_parameter_order_change);
617617

618+
CommandCounterIncrement();
619+
618620
/* Fetch new CAgg definition from catalog */
619621
ContinuousAgg PG_USED_FOR_ASSERTS_ONLY *new_cagg_definition =
620622
cagg_get_by_relid_or_fail(cagg_relid);

tsl/test/expected/cagg_bgw-17.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ SELECT mat_hypertable_id, user_view_schema, user_view_name FROM _timescaledb_cat
109109
2 | public | test_continuous_agg_view
110110
(1 row)
111111

112-
SELECT mat_hypertable_id, bucket_width FROM _timescaledb_catalog.continuous_aggs_bucket_function;
112+
SELECT mat_hypertable_id, bucket_width FROM _timescaledb_catalog.continuous_agg, LATERAL _timescaledb_functions.cagg_get_bucket_function_info(mat_hypertable_id);
113113
mat_hypertable_id | bucket_width
114114
-------------------+--------------
115115
2 | 2

0 commit comments

Comments
 (0)