TEMPORAL JOIN: USING clause and ON clause with equality qualifiers should produce different results
Currently we just rewrite USING clause into an ON clause with equality comparisons. This is not always correct, because USING clauses normally project away columns that are not mentioned within USING on the RHS. The non-temporal JOIN behavior must be mimicked for temporal JOINS.
For example: See this non-temporal JOIN...
A=# table test;
a | b | ts | te
---+---+----+----
a | B | 1 | 7
b | B | 3 | 9
c | G | 8 | 10
(3 rows)
A=# select * from test join test t2 using (a);
a | b | ts | te | b | ts | te
---+---+----+----+---+----+----
a | B | 1 | 7 | B | 1 | 7
b | B | 3 | 9 | B | 3 | 9
c | G | 8 | 10 | G | 8 | 10
(3 rows)
A=# select * from test join test t2 on test.a = t2.a;
a | b | ts | te | a | b | ts | te
---+---+----+----+---+---+----+----
a | B | 1 | 7 | a | B | 1 | 7
b | B | 3 | 9 | b | B | 3 | 9
c | G | 8 | 10 | c | G | 8 | 10
(3 rows)