Skip to content

Postgres: Support aliases for JOIN USING - #2492

Open
BenSatori wants to merge 3 commits into
apache:mainfrom
BenSatori:postgres-join-using-alias
Open

BenSatori wants to merge 3 commits into
apache:mainfrom
BenSatori:postgres-join-using-alias

Conversation

@BenSatori

Copy link
Copy Markdown
Contributor

Support PostgreSQL's optional alias on JOIN USING columns, e.g. JOIN t2 USING (id) AS joined_cols.

PostgreSQL documents this as USING ( join_column [, ...] ) [ AS join_using_alias ]: https://www.postgresql.org/docs/current/sql-select.html

Implementation notes:

  • Preserve the existing JoinConstraint::Using(Vec<ObjectName>) variant for joins without aliases.
  • Add JoinConstraint::UsingAlias(Vec<ObjectName>, Ident) for the alias form.
  • Add a minimal PostgreSQL regression test.

AI assistance was used to prepare this change.

@codecov-commenter

codecov-commenter commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.10%. Comparing base (560a13c) to head (0497ea7).

Files with missing lines Patch % Lines
src/parser/mod.rs 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2492   +/-   ##
=======================================
  Coverage   81.09%   81.10%           
=======================================
  Files          42       42           
  Lines       33684    33694   +10     
  Branches    33684    33694   +10     
=======================================
+ Hits        27316    27326   +10     
+ Misses       2798     2797    -1     
- Partials     3570     3571    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LucaCappelletti94 LucaCappelletti94 added waiting on contributor The review needs further refinements by its author needs rebasing The PR has collisions with main and requires rebasing and removed waiting on contributor The review needs further refinements by its author labels Sep 24, 2026
@LucaCappelletti94 LucaCappelletti94 removed the needs rebasing The PR has collisions with main and requires rebasing label Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants