AM07 — Set-operation branches select different column counts
Group: Ambiguity · Auto-fixable: no
UNION/EXCEPT/INTERSECT require every branch to project the same number of
columns; otherwise Postgres rejects the query. Branches containing * are
skipped because their width is not known without the schema.
Example
Section titled “Example”bad: SELECT a, b FROM t UNION SELECT c FROM ugood: SELECT a, b FROM t UNION SELECT c, d FROM uConfigure
Section titled “Configure”Disable this rule in banshee.toml:
[lint]exclude = ["AM07"]Or silence one line with -- noqa: AM07. See Linting.