BenSatori opened a new pull request, #2509: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2509
## Example Before this PR, none of these valid Postgres queries parsed: ```sql SELECT 1 AS U&"d\0061ta", * from customers; SELECT * from U&"c\0075stomers" limit 10; SELECT * from U&"c!0075stomers" UESCAPE '!' limit 10; ``` `U&"..."` Unicode-escaped quoted identifiers were not tokenized at all (only the `U&'...'` string literal form was supported), and the `UESCAPE '<char>'` clause that can follow either a `U&'...'` string or a `U&"..."` identifier to override the default `\` escape character was not implemented, even though the `UESCAPE` keyword already existed in `keywords.rs`. ## Fix `U&"..."` identifiers now tokenize into a regular quoted identifier (decoded, e.g. `U&"d\0061ta"` -> `"data"`), and both `U&'...'` and `U&"..."` now support an optional trailing `UESCAPE '<char>'` clause. See the [Postgres docs](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS) (identifiers) and [UESCAPE docs](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS-UESCAPE) (escape clause). Relates to #1354, which added the `U&'...'` string literal support this PR extends. This PR was authored with the assistance of GitHub Copilot. -- 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]
