René's URL Explorer Experiment


Title: Parse PostgreSQL Unicode escape string constants by minleejae · Pull Request #2820 · JSQLParser/JSqlParser · GitHub

Open Graph Title: Parse PostgreSQL Unicode escape string constants by minleejae · Pull Request #2820 · JSQLParser/JSqlParser

X Title: Parse PostgreSQL Unicode escape string constants by minleejae · Pull Request #2820 · JSQLParser/JSqlParser

Description: Purpose Parse PostgreSQL string constants with Unicode escapes (U&'...', optionally followed by UESCAPE 'c') with Dialect.POSTGRESQL. Today: SELECT U&'\0041BC \00e9' silently becomes U & '\0041BC \00e9': the column U, the & operator and a string. PostgreSQL reads the string ABC é. COMMENT ON TABLE t IS U&'\0041BC \00e9' fails because the comment must be a literal. Column defaults such as DEFAULT U&'\0041' get the same bitwise reading. U&'d!0061t!+000061' UESCAPE '!' fails in every position. There is no way to get the value the server stores. Current design (As-is) S_CHAR_LITERAL knows the prefixes U, E, N, R, B, RB and _utf8, but not U&. U&'x' is lexed as the identifier U, & and 'x'. StringValue.Escaping (#2791) covers standard strings, MySQL backslash escapes and PostgreSQL E'' strings. UESCAPE is not a token. Target design (To-be) Lexing S_CHAR_LITERAL gets a U&'...' alternative. It reads doubled quotes, and backslashes do not escape quotes, as in PostgreSQL. An optional UESCAPE 'c' clause after spaces, tabs or newlines belongs to the same token. Every place that takes a string literal therefore accepts the clause, and no keyword is added. The token is kept only with Dialect.POSTGRESQL. Otherwise the token action shortens it to the identifier U, so U&'x' keeps its current reading. U & 'x', U & 1 and a & b are unchanged in every dialect. With the PostgreSQL dialect, the lexer rejects literals that PostgreSQL rejects: an escape without its hex digits, code point 0 or one above U+10FFFF, an unpaired surrogate, and an escape character that is a hex digit, +, a quote, whitespace or not ASCII. The input is rewound before the error, so lookahead helpers that catch lexer errors cannot skip the literal. StringValue New Escaping.POSTGRESQL_UNICODE_ESCAPE, and getUnicodeEscapeCharacter()/setUnicodeEscapeCharacter()/withUnicodeEscapeCharacter(). The value is null when there is no UESCAPE clause. The constructor reads U&'body' [UESCAPE 'c']. The prefix is U& and getValue() is the body as written. getNotExcapedValue() resolves \XXXX, \+XXXXXX, surrogate pairs written as two escapes, doubled escape characters and doubled quotes. It runs in linear time. For a constructed value that PostgreSQL would reject, it throws IllegalArgumentException. toString() and ExpressionDeParser render UESCAPE 'c' after the literal. Scope: other U& positions and literal handling are unchanged: A newline-separated continuation of a U& literal is concatenated as before and keeps the Unicode escaping, as in PostgreSQL. UESCAPE after a comment or after a continuation line is not supported. U&"..." quoted identifiers are not covered. usage.rst gets a "PostgreSQL Unicode escape strings" section next to "String literal values". Validation New tests: decoded values, for example U&'\0041BC \00e9' → ABC é, U&'d!0061t!+000061' UESCAPE '!' → data, U&'\+01F600' and U&'\D83D\DE00' → 😀, U&'a\\b' → a\b, U&'it''s' → it's; with the PostgreSQL dialect, parse → render → reparse of COMMENT ON, CREATE TABLE ... DEFAULT, ALTER COLUMN ... SET DEFAULT, INSERT ... VALUES, and WHERE/LIKE expressions; 17 invalid literals, rejected in a select list, in function arguments and in COMMENT ON; the default configuration, MySQL, Oracle, SQL Server and ANSI SQL keep the bitwise reading. So does U & 'x' with PostgreSQL. Strings starting with & are unchanged; constructed values, ExpressionDeParser output, and linear-time decoding of 1,000,000 escapes. Java 17 offline Gradle spotlessApply check: 10,361 tests, 10,336 passed, 25 skipped, zero failures/errors. The grammar choice conflict check passes. Compared with master (bdf8ac31) on the DDL/DCL survey corpora (MySQL 8.4 and PostgreSQL 18, with and without a dialect), every result is unchanged. The PostgreSQL comment corpora have 3 U& comments, which used to fail. They now parse, with values ABC é, ABC é and data. MySQL 8.4 and PostgreSQL 18.3: every corpus statement this branch parses ran as written on one server and as rendered by toString() on a second, identical server, in the same order. All 205 MySQL and 327 PostgreSQL statements give the same result (success, or the same error). PostgreSQL 18.3 ran SELECT on 39 U& literals covering the escape forms, UESCAPE, surrogate pairs and invalid literals. For the 22 the server accepts, getNotExcapedValue() is byte-identical to the value the server returns. The parser rejects the other 17, which the server also rejects. The same check on the comment corpora (statements that create, alter and read MySQL and PostgreSQL comments): all 49 MySQL and 66 PostgreSQL statements this branch parses give the same results, including COMMENT ON TABLE … IS U&'…', which used to fail. Afterwards, every stored comment (MySQL table, column, index, partition, routine and event comments; PostgreSQL pg_description) is byte-identical on both servers. Integration validation Applied this PR together with the other comment PRs (#2821, #2822, #2824, #2823), the DDL/DCL PRs #2806–#2819 and #2778 on master (bdf8ac31), with the stacked PRs on top of their bases (#2814 → #2821, #2816 → #2822, #2806 → #2824 and #2811 → #2812 → #2823). Each branch merges cleanly into master. Between the branches, conflicts are limited to adjacent additions (README/index rows, usage sections, imports, test methods, visitor and feature lists, an enum line and an alias guard). The integrated build passes Java 17 offline Gradle spotlessApply check: 11,877 tests, 11,852 passed, 25 skipped, zero failures/errors. The grammar choice conflict check passes. On the corpus of 635 MySQL 8.4 and PostgreSQL 18 DDL/DCL statements, the integrated build parses 265 of 271 MySQL statements (master: 206) and 363 of 364 PostgreSQL statements (master: 328), the same as #2806–#2819 together. There are no regressions. On the comment corpora and an extra set of comment edge cases, the integrated build returns a typed statement for all 80 MySQL statements (master: 67) and for 118 of 119 PostgreSQL statements (master: 76). The exception is a CREATE AGGREGATE setup statement. Every table, column, index, partition, routine, event, user and COMMENT ON comment literal is a StringValue, except COMMENT = _utf8mb4'x', which MySQL rejects. On paired MySQL 8.4 and PostgreSQL 18.3 servers, all 263 MySQL and 362 PostgreSQL DDL/DCL statements and all 56 MySQL and 90 PostgreSQL comment statements rendered by the integrated build give the same results as the originals. The stored comments are identical on both servers.

Open Graph Description: Purpose Parse PostgreSQL string constants with Unicode escapes (U&'...', optionally followed by UESCAPE 'c') with Dialect.POSTGRESQL. Today: SELECT U&'\0041BC \00e9'...

X Description: Purpose Parse PostgreSQL string constants with Unicode escapes (U&'...', optionally followed by UESCAPE 'c') with Dialect.POSTGRESQL. Today: SELECT U&am...

Opengraph URL: https://github.com/JSQLParser/JSqlParser/pull/2820

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ef061edb-db76-05a5-917d-6a0049ff1c3c
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC876:22C2DF:19A681:22531E:6B049772
html-safe-nonce2adc99eeec8a17d2ae044384d4d98b9f2ef8298705a8621ccca0efc78bc424cd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODc2OjIyQzJERjoxOUE2ODE6MjI1MzFFOjZCMDQ5NzcyIiwidmlzaXRvcl9pZCI6IjQ1NDgwNTk2NDM1MzQ3NjQ2NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc0e02ba7f1cf08f56729656c40bc52fe2a66c890b4aa5bc2b674529db5fff84f
hovercard-subject-tagpull_request:4856000718
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/JSQLParser/JSqlParser/pull/2820/files
twitter:imagehttps://avatars.githubusercontent.com/u/55116920?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/55116920?s=400&v=4
og:image:altPurpose Parse PostgreSQL string constants with Unicode escapes (U&'...', optionally followed by UESCAPE 'c') with Dialect.POSTGRESQL. Today: SELECT U&'\0041BC \00e9'...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/JSQLParser/JSqlParser git https://github.com/JSQLParser/JSqlParser.git
octolytics-dimension-user_id4643847
octolytics-dimension-user_loginJSQLParser
octolytics-dimension-repository_id1944709
octolytics-dimension-repository_nwoJSQLParser/JSqlParser
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1944709
octolytics-dimension-repository_network_root_nwoJSQLParser/JSqlParser
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3fd14143b75b2af7b76bbd23b069867d091adfcc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/JSQLParser/JSqlParser/pull/2820/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2820%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2820%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=JSQLParser%2FJSqlParser
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2820/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2820/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2820/files
JSQLParserhttps://github.com/JSQLParser
JSqlParserhttps://github.com/JSQLParser/JSqlParser
Codehttps://github.com/JSQLParser/JSqlParser
Issues2 (2)https://github.com/JSQLParser/JSqlParser/issues
Pull requests2 (2)https://github.com/JSQLParser/JSqlParser/pulls
Discussionshttps://github.com/JSQLParser/JSqlParser/discussions
Actionshttps://github.com/JSQLParser/JSqlParser/actions
Projectshttps://github.com/JSQLParser/JSqlParser/projects
Wikihttps://github.com/JSQLParser/JSqlParser/wiki
Security and qualityhttps://github.com/JSQLParser/JSqlParser/security
Insightshttps://github.com/JSQLParser/JSqlParser/insights
Sign up for GitHub https://github.com/signup?return_to=%2FJSQLParser%2FJSqlParser%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FJSQLParser%2FJSqlParser%2Fissues%2Fnew%2Fchoose
manticore-projectshttps://github.com/manticore-projects
JSQLParser:masterhttps://github.com/JSQLParser/JSqlParser/tree/master
minleejae:feat/postgresql-unicode-strings-20261014https://github.com/minleejae/JSqlParser/tree/feat/postgresql-unicode-strings-20261014
Conversation 0 https://github.com/JSQLParser/JSqlParser/pull/2820
Commits 1 https://github.com/JSQLParser/JSqlParser/pull/2820/commits
Checks 10 https://github.com/JSQLParser/JSqlParser/pull/2820/checks
Files changed https://github.com/JSQLParser/JSqlParser/pull/2820/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2820/files
Parse PostgreSQL Unicode escape string constants https://github.com/JSQLParser/JSqlParser/pull/2820/files#top
Show all changes 1 commit https://github.com/JSQLParser/JSqlParser/pull/2820/files
99dd9e9 feat: parse PostgreSQL Unicode escape string constants minleejae Oct 14, 2026 https://github.com/JSQLParser/JSqlParser/pull/2820/commits/99dd9e917ef22b7b64874e7e8ba4ceb574fbb0b0
Clear filters https://github.com/JSQLParser/JSqlParser/pull/2820/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2820/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2820/files
StringValue.java https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
ExpressionDeParser.java https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-1ce55172b9d695a35ec4bae38258bacd8087d9c367f59a808c6dd6de1c3f905e
JSqlParserCC.jjt https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
usage.rst https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-1d76e581381361db03988ab6bd07be336cb8129b61bda04ab3fe334209488c2c
StringValueTest.java https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-5790f81bfdd2c85fd862bf7cf1c58cb00d5d26e20579b26786f136885e1b7575
CCJSqlParserUtilTest.java https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-09a1b114803393af95bc7a3f8033d0585b6b17c4cd15ca334e98de5fac5aefae
src/main/java/net/sf/jsqlparser/expression/StringValue.javahttps://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
View file https://github.com/minleejae/JSqlParser/blob/99dd9e917ef22b7b64874e7e8ba4ceb574fbb0b0/src/main/java/net/sf/jsqlparser/expression/StringValue.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2820/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-50f987ed2e171dd55801e903845989832371b4953890439b26b65a19bc18d7e5
src/main/java/net/sf/jsqlparser/util/deparser/ExpressionDeParser.javahttps://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-1ce55172b9d695a35ec4bae38258bacd8087d9c367f59a808c6dd6de1c3f905e
View file https://github.com/minleejae/JSqlParser/blob/99dd9e917ef22b7b64874e7e8ba4ceb574fbb0b0/src/main/java/net/sf/jsqlparser/util/deparser/ExpressionDeParser.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2820/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-1ce55172b9d695a35ec4bae38258bacd8087d9c367f59a808c6dd6de1c3f905e
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-1ce55172b9d695a35ec4bae38258bacd8087d9c367f59a808c6dd6de1c3f905e
src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjthttps://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
View file https://github.com/minleejae/JSqlParser/blob/99dd9e917ef22b7b64874e7e8ba4ceb574fbb0b0/src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2820/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2820/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2820/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2820/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.