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.
This commit is contained in:
Sven Klemm 2024-02-14 14:22:31 +01:00 committed by Sven Klemm
parent fc0e41cc13
commit 87430168b5

View File

@ -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;