Commit a9ecb8f
committed
[Pg-kit]: Fix unique constraint introspection query
The current query uses constraint_column_usage which creates a Cartesian
product when joined with the columns table, returning zero rows for
multi-column unique constraints.
This fix replaces constraint_column_usage with key_column_usage (the
standard table for PRIMARY KEY and UNIQUE constraints) and properly
joins on constraint_name, constraint_schema, and table_name.
Fixes #4490, #4531, #49211 parent 47ba9c8 commit a9ecb8f
1 file changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1228 | 1228 | | |
1229 | 1229 | | |
1230 | 1230 | | |
1231 | | - | |
| 1231 | + | |
1232 | 1232 | | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
1237 | 1243 | | |
1238 | 1244 | | |
1239 | 1245 | | |
| |||
0 commit comments