From 87430168b5c91a6ee4da2d7fc08d12e13a447205 Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Wed, 14 Feb 2024 14:22:31 +0100 Subject: [PATCH] Fix downgrade script to make backports easier While the downgrade script doesnt combine multiple version into a single script since we only create the script for the previous version, fixing this will make backporting in the release branch easier. --- sql/updates/2.14.0--2.13.1.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/2.14.0--2.13.1.sql b/sql/updates/2.14.0--2.13.1.sql index a3a6600ed..319f07e62 100644 --- a/sql/updates/2.14.0--2.13.1.sql +++ b/sql/updates/2.14.0--2.13.1.sql @@ -88,7 +88,7 @@ BEGIN -- restore columns from the compressed hypertable FOR column_name, column_type IN - SELECT attname, atttypid::regtype FROM pg_attribute WHERE attrelid = chunk AND attnum > 0 + SELECT attname, atttypid::regtype FROM pg_attribute WHERE attrelid = chunk AND attnum > 0 AND NOT attisdropped LOOP cmd := format('ALTER TABLE %s ADD COLUMN %I %s', hypertable, column_name, column_type); EXECUTE cmd;