Skip to content

Parser: Stop an ANY/ALL subquery operand at its closing parenthesis - #3067

Open
yussypu wants to merge 1 commit into
apache:mainfrom
yussypu:any-all-subquery-operand
Open

yussypu wants to merge 1 commit into
apache:mainfrom
yussypu:any-all-subquery-operand

Conversation

@yussypu

@yussypu yussypu commented Nov 28, 2026

Copy link
Copy Markdown

Dialects: PostgreSQL

Closes #2802

a = ANY(SELECT 1) - 1 parsed as a = ANY((SELECT 1) - 1), and 1 = ANY(SELECT 1)::text as a cast of the subquery. PostgreSQL applies the operator to the comparison, since the right side is a parenthesized subquery: https://www.postgresql.org/docs/current/functions-subquery.html#FUNCTIONS-SUBQUERY-ANY-SOME. The subquery branch now parses only the query and stops at its ).

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.

x = ANY(SELECT ...) <op> y: the operator after ) is parsed into the ANY/ALL operand

1 participant