Skip to content

Commit

Permalink
Move view creation in setup.repair inside if
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
konskov committed Sep 7, 2023
1 parent 44e41c1 commit 38f809d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/sql/updates/setup.repair.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
(
Expand All @@ -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.
Expand Down

0 comments on commit 38f809d

Please sign in to comment.