Skip to content

Commit

Permalink
Fix missing upgrade/downgrade tests DDL validation
Browse files Browse the repository at this point in the history
Recently we fixed a DDL error (timescale#4739) after upgrading to 2.8.0 version
that surprisly the CI upgrade/dowgrade tests didn't complained during
the development of the feature (timescale#4552).

Fixed it by adding an specific query in the `post.catalog.sql` script to
make sure we'll check all the constraints of our internal tables and
catalog.
  • Loading branch information
fabriziomello committed Sep 30, 2022
1 parent f7c769c commit bbd04c4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/sql/updates/post.catalog.sql
Expand Up @@ -27,9 +27,9 @@ WHERE classoid = 'pg_class'::regclass
ORDER BY schema, name, initpriv;

\di _timescaledb_catalog.*
\ds+ _timescaledb_catalog.*;
\df _timescaledb_internal.*;
\df+ _timescaledb_internal.*;
\ds+ _timescaledb_catalog.*
\df _timescaledb_internal.*
\df+ _timescaledb_internal.*
\df public.*;
\df+ public.*;

Expand All @@ -43,9 +43,7 @@ SELECT count(*)
AND refobjid = (SELECT oid FROM pg_extension WHERE extname = 'timescaledb');

-- The list of tables configured to be dumped.
SELECT obj::regclass::text
FROM (SELECT unnest(extconfig) AS obj FROM pg_extension WHERE extname='timescaledb') AS objects
ORDER BY obj::regclass::text;
SELECT unnest(extconfig)::regclass::text AS obj FROM pg_extension WHERE extname='timescaledb' ORDER BY 1;

-- Show dropped chunks
SELECT *
Expand Down Expand Up @@ -75,3 +73,8 @@ FROM pg_depend dep
WHERE classid='pg_class'::regclass
ORDER BY attrelid::regclass::text,att.attnum;

-- Show constraints
SELECT conrelid::regclass::text, conname, pg_get_constraintdef(oid)
FROM pg_constraint
WHERE conrelid::regclass::text ~ '^_timescaledb_'
ORDER BY 1, 2, 3;

0 comments on commit bbd04c4

Please sign in to comment.