We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a5b823 commit 521f893Copy full SHA for 521f893
sql/check_not_valid_constraints.sql
@@ -0,0 +1,19 @@
1
+/*
2
+ * Copyright (c) 2019-2024. Ivan Vakhrushev and others.
3
+ * https://github.com/mfvanek/pg-index-health-sql
4
+ *
5
+ * Licensed under the Apache License 2.0
6
+ */
7
+
8
+select
9
+ t.relname as table_name, -- Name of the table
10
+ c.conname as constraint_name, -- Name of the constraint
11
+ c.contype as constraint_type -- Type of the constraint
12
+from
13
+ pg_catalog.pg_constraint c
14
+ join pg_catalog.pg_class t on t.oid = c.conrelid
15
+ join pg_catalog.pg_namespace n on n.oid = t.relnamespace
16
+where
17
+ not c.convalidated -- Constraints that have not yet been validated
18
+ and c.contype in ('c', 'f') -- Focus on check and foreign key constraints
19
+ and n.nspname = :schema_name_param::text; -- Make the query schema-aware
0 commit comments