fix: resolve operator ambiguity in i3 foreign key check #72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the "operator is not unique" error in the i3 (foreign keys with missing or bad indexes) check by adding explicit type casting to the
key_cols
parameter.Problem
Users reported encountering this error when running the i3 check:
This occurred on line 66 of
i3_non_indexed_fks.sql
where the@>
operator was being used withoperator(pg_catalog.@>)
syntax to avoid conflicts with the intarray extension (fixed in PR #35), but PostgreSQL still couldn't resolve which operator to use due to type ambiguity.Solution
Added explicit
::int2[]
cast to thekey_cols
parameter to match the left side of the comparison, ensuring PostgreSQL knows exactly which@>
operator to use:Both sides are now explicitly
int2[]
(smallint array), eliminating the ambiguity.Fixes #62