LucaCappelletti94 opened a new pull request, #2731: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2731
`CREATE ROLE a CONNECTION LIMIT -1` and `ALTER ROLE a CONNECTION LIMIT -1` failed to parse under `PostgreSqlDialect`. PostgreSQL's role grammar takes a signed integer after `CONNECTION LIMIT`, and `-1` is the documented way to remove the limit (https://www.postgresql.org/docs/current/sql-createrole.html). PostgreSQL 18 accepts both statements and stores `-1`. Both sites read the limit with `parse_number_value`, which only takes an unsigned literal. They now call `parse_number`, which takes an optional sign and returns `Expr::UnaryOp` for a signed value. `CreateRole::connection_limit` and `RoleOption::ConnectionLimit` already hold an `Expr`, so the AST is unchanged. Range checking stays with the engine, since PostgreSQL rejects other negative values only after parsing. -- 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]
