From 9a466ca185ba3df611cbdb460b7b4aa906fcdf2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabr=C3=ADzio=20de=20Royes=20Mello?= Date: Mon, 10 Apr 2023 14:33:48 -0300 Subject: [PATCH] Silence WARNING after extension update Commit 8afdddc2da added the first step for deprecating the old format of Continuous Aggregate but just for PostgreSQL 15 and later versions. During the extension update we emit a message about the deprecation but this has being emited even if the user is using PostgreSQL versions before 15. Fixed it by emiting the WARNING just when PostgreSQL version is greater or equal to 15. --- sql/updates/post-update.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/updates/post-update.sql b/sql/updates/post-update.sql index 141a8ce60..2c9ea48c3 100644 --- a/sql/updates/post-update.sql +++ b/sql/updates/post-update.sql @@ -142,9 +142,10 @@ BEGIN format('%I.%I', user_view_schema, user_view_name) FROM _timescaledb_catalog.continuous_agg WHERE finalized IS FALSE + AND current_setting('server_version_num')::int >= 150000 ORDER BY 1 LOOP - RAISE WARNING 'Continuous Aggregate: % with old format will not be supported with PG15. You should upgrade to the new format', cagg_name; + RAISE WARNING 'Continuous Aggregate: % with old format will not be supported on PostgreSQL version greater or equal to 15. You should upgrade to the new format', cagg_name; END LOOP; END $$;