Skip to content

Commit 078292c

Browse files
committed
Support partitioning for columns checks
1 parent e0185b6 commit 078292c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

sql/columns_with_json_type.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ from
1818
inner join pg_catalog.pg_namespace nsp on nsp.oid = t.relnamespace
1919
inner join pg_catalog.pg_attribute col on col.attrelid = t.oid
2020
where
21-
t.relkind = 'r' and
21+
t.relkind in ('r', 'p') and
22+
not t.relispartition and
2223
col.attnum > 0 and /* to filter out system columns such as oid, ctid, xmin, xmax, etc. */
2324
not col.attisdropped and
2425
col.atttypid = 'json'::regtype and

sql/columns_with_serial_types.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ with
4242
group by c.conrelid, c.conkey[1]
4343
) c on true
4444
where
45-
t.relkind = 'r' and
45+
t.relkind in ('r', 'p') and
46+
not t.relispartition and
4647
col.attnum > 0 and /* to filter out system columns such as oid, ctid, xmin, xmax, etc. */
4748
not col.attisdropped and
4849
col.atttypid = any('{int,int8,int2}'::regtype[]) and

0 commit comments

Comments
 (0)