Move view creation in setup.repair inside if

Previously the view was created outside the if, leading to an unexpected
error when attempting to drop a dependency of the view in the
extension upgrade script.
This commit is contained in:
Konstantina Skovola 2023-09-07 16:30:45 +03:00 committed by Konstantina Skovola
parent 44e41c12ab
commit 38f809d4b5

View File

@ -65,6 +65,8 @@ INSERT INTO repair_test_date VALUES
ALTER TABLE _timescaledb_catalog.chunk_constraint
DROP CONSTRAINT chunk_constraint_dimension_slice_id_fkey;
\if :test_repair_dimension
CREATE VIEW slices AS (
SELECT ch.hypertable_id,
(
@ -88,7 +90,6 @@ CREATE VIEW slices AS (
ON di.hypertable_id = ch.hypertable_id AND attname = di.column_name
);
\if :test_repair_dimension
-- Break the first time dimension on each table. These are different
-- depending on the time type for the table and we need to check all
-- versions.