Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TABLES_NOT_LINKED_TO_OTHERS] Decide how to handle partitioned tables #65

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sql/tables_not_linked_to_others.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ from
inner join nsp on nsp.oid = pc.relnamespace
where
pc.relkind in ('r', 'p') and
not pc.relispartition and
pc.oid not in (select * from fkeys)
order by table_name;
3 changes: 2 additions & 1 deletion sql/tables_without_primary_key.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ from
pg_catalog.pg_class pc
inner join pg_catalog.pg_namespace nsp on nsp.oid = pc.relnamespace
where
pc.relkind = 'r' and
pc.relkind in ('r', 'p') and
/* here we do not filter by pc.relispartition, because very often primary keys are created only for partitions */
pc.oid not in (
select c.conrelid as table_oid
from pg_catalog.pg_constraint c
Expand Down
Loading