Skip to content

Commit 815bad7

Browse files
committed
Verify relation existance before casting to regclass
1 parent 40b8846 commit 815bad7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

diagnostic.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ BEGIN
226226
format('%I.%I',ch.schema_name, ch.table_name) chunk,
227227
format('%I.%I',ch2.schema_name, ch2.table_name) compressed
228228
FROM _timescaledb_catalog.chunk ch
229+
JOIN pg_class c_ch ON c_ch.relname = ch.table_name AND c_ch.relnamespace = ch.schema_name::regnamespace
229230
JOIN _timescaledb_catalog.chunk ch2 ON ch2.id = ch.compressed_chunk_id
231+
JOIN pg_class c_ch2 ON c_ch2.relname = ch2.table_name AND c_ch2.relnamespace = ch2.schema_name::regnamespace
230232
WHERE ch.hypertable_id = v_hypertable_id
231233
LOOP
232234
RAISE DEBUG ' Checking chunk: %', v_chunk;

0 commit comments

Comments
 (0)