Skip to content

Postgres: Support aliases for JOIN USING - #2492

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

Postgres: Support aliases for JOIN USING#2492
BenSatori wants to merge 2 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant