oguimbal / pg-mem

An in memory postgres DB instance for your unit tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using "using" on joins leads to wrong "ambiguous reference" errors

rswheeldon opened this issue Β· comments

Describe the bug

Doing a join with "using" for a column ID implies it's not ambiguous - it doesn't matter which one you pick because they're the same. Postgres realizes this but pg-mem doesn't.

column reference "x" is ambiguous

🐜 This seems to be an execution error, which means that your request syntax seems okay,
    but the resulting statement cannot be executed β†’ Probably not a pg-mem error.

*️⃣ Reconsituted failed SQL statement: SELECT x  FROM foo  INNER JOIN bar  USING (x)

To Reproduce

create table foo(x integer);
create table bar (x integer);

select x from foo join bar using (x);

pg-mem version

2.8.1 (reproducible in playground at time of writing)