JOIN … USING: Ambiguous column references now return an error (Pending)

Attention

This behavior change is in the 2026_04 bundle.

For the current status of the bundle, refer to Bundle history.

Before the change:

When you use a JOIN … USING clause, queries with ambiguous column references incorrectly succeed instead of returning an error. For example, if both t1 and t2 have a col3 column that isn’t part of the USING clause:

-- Succeeds but silently resolves col3 from the left table (incorrect)
SELECT col3 FROM t1 JOIN t2 USING (col1, col2);

-- Returns an "ambiguous column name" error (correct)
SELECT col3 FROM t1 JOIN t2 ON t1.col1 = t2.col1;

These two equivalent queries behave differently. The first can produce wrong results because the ambiguous column is silently resolved instead of flagged.

After the change:

Queries that use JOIN … USING with ambiguous column references now correctly return an error that identifies which columns are ambiguous. This makes the behavior consistent with JOIN … ON and ensures SQL standard correctness.

To fix affected queries, qualify the ambiguous column references with a table name or alias:

SELECT t1.col3 FROM t1 JOIN t2 USING (col1, col2);

For more information, see JOIN.

Ref: 2256