LucaCappelletti94 opened a new pull request, #2774:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2774

   `SELECT f(x := 1)` parsed under `PostgreSqlDialect` as one positional 
argument holding a `BinaryOp` with the `Assignment` operator, so the argument 
name was lost, while `SELECT f(x => 1)` gave `FunctionArg::ExprNamed`. 
PostgreSQL accepts both `name => value` and `name := value` for named arguments 
(https://www.postgresql.org/docs/current/sql-syntax-calling-funcs.html#SQL-SYNTAX-CALLING-FUNCS-NAMED),
 and PostgreSQL 18 runs `SELECT f(x := 1, y => 2)` and `CALL p(a := 1, b => 2)`.
   
   `PostgreSqlDialect` now enables 
`supports_named_fn_args_with_assignment_operator`. The flag alone did not help, 
because this dialect parses each argument as a full expression before looking 
for a named-argument operator, and `:=` was an infix operator that the 
expression had already consumed. `:=` now gets the lowest precedence under 
PostgreSQL, as `:` already does for `json_object('a': 1)`. PostgreSQL has no 
`:=` expression operator, so `SELECT x := 1` now fails to parse, as it does on 
the server.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to