René's URL Explorer Experiment
Title: Allow more MySQL and PostgreSQL keywords as unquoted identifiers by minleejae · Pull Request #2815 · JSQLParser/JSqlParser · GitHub
Open Graph Title: Allow more MySQL and PostgreSQL keywords as unquoted identifiers by minleejae · Pull Request #2815 · JSQLParser/JSqlParser
X Title: Allow more MySQL and PostgreSQL keywords as unquoted identifiers by minleejae · Pull Request #2815 · JSQLParser/JSqlParser
Description: Purpose
Allow keywords that MySQL 8.4 and PostgreSQL 18 accept as unquoted column and table names. A sweep of MySQL's non-reserved words and PostgreSQL's unreserved and column-name keywords, each used as a column in CREATE TABLE, in ALTER TABLE ... ADD COLUMN and as a table name, found 38 statements that fail and 26 CREATE TABLE (...) statements that silently become an UnsupportedStatement. Each server accepts the words of its own list, for example:
-- MySQL 8.4
CREATE TABLE t (current INT, only INT, returning INT, sql_no_cache INT);
ALTER TABLE t ADD COLUMN offset INT;
CREATE TABLE value (a INT);
-- PostgreSQL 18
CREATE TABLE t (prior int, unknown int, between int, xmlserialize int, p path);
ALTER TABLE t ADD COLUMN set int;
Current design (As-is)
ABSENT, CURRENT, FORCE, IMPORT, PRIOR, SQL_NO_CACHE, UNBOUNDED, UNKNOWN and XMLSERIALIZE are reserved, although each one only starts a clause in a few places.
BETWEEN, FULL, ONLY and RETURNING are reserved and are not in the list of reserved words that RelObjectName() accepts in name positions (like LEFT, ORDER, SET, VALUE).
Those listed words are only names after a delimiter, after a clause keyword or before a safe follower. After TABLE or COLUMN, CREATE TABLE value (a INT) and ADD COLUMN offset INT fail; for CREATE TABLE the statement falls back to an UnsupportedStatement.
A CREATE TABLE element that starts with EXCLUDE is always read as an exclusion constraint, so a column named exclude fails.
ColDataType() does not accept the PATH token, so PostgreSQL's geometric type path fails.
keywords.rst still lists EXISTS, EXTEND, SAMPLE and STATEMENT, which #2706, #2773 and #2774 made non-reserved.
Target design (To-be)
Non-reserved words, moved into NonReservedWord() (as in #2793). Each keeps its keyword use through these guards:
PRIOR is Oracle's operator only when an operand follows (PRIOR id, PRIOR (a), PRIOR 2), not in prior = 1, prior IS NULL or ORDER BY prior DESC.
SQL_NO_CACHE is a MySQL select modifier only before a select item.
FORCE INDEX|KEY (...) is an index hint, never an implicit alias.
UNBOUNDED PRECEDING|FOLLOWING, XMLSERIALIZE ( and ABSENT ON NULL keep their meaning.
current.x is a qualified column. CURRENT alone stays a TimeKeyExpression as before.
Reserved words that are names in name positions: BETWEEN, FULL, ONLY and RETURNING are added to that list in RelObjectName(). They start clauses after an expression or a table, so they stay reserved:
FULL follows the LEFT/RIGHT rule. It is an implicit alias unless a join follows, so FROM t full works and FROM a FULL JOIN b is unchanged.
BETWEEN, ONLY and RETURNING are never implicit aliases (AS still works).
ONLY before a relation name after FROM, JOIN, UPDATE, INTO, USING or , is PostgreSQL's inheritance prefix. Forms that are still unsupported, such as DELETE FROM ONLY t or JOIN ONLY t, fail as before instead of naming a table only.
JSON_ARRAY(RETURNING JSON) and JSON_OBJECT(ABSENT ON NULL) keep their clauses.
A word after TABLE or COLUMN is always a name. IF [NOT] EXISTS and ONLY are matched before the name, as before.
EXCLUDE starts an exclusion constraint only before USING, ( or WHERE. PATH is accepted as a column type, but not as the type of a JSON_TABLE column, where it introduces the path.
NonReservedWord() is split into two productions:
At master, the lookahead routine that JavaCC generates for the single choice of 425 words has 7,951 bytes of bytecode. 9 more words take it to 8,122 bytes, above the JVM's 8,000 byte limit for JIT compilation (-XX:HugeMethodLimit), so it would always run interpreted. Measured, that cost about 5% on the benchmark below.
With the split, the largest routine has 4,222 bytes. The token kinds stay between the MIN_NON_RESERVED_WORD/MAX_NON_RESERVED_WORD sentinels.
Two optional guards became choices (PRIOR before a condition and the SQL_NO_CACHE modifier). JavaCC does not evaluate a semantic lookahead on [...] or (...)* while it scans an enclosing syntactic lookahead, and a choice keeps that guard.
keywords.rst is regenerated with updateKeywords. 88 words are reserved (was 100) and 434 non-reserved (was 425).
Not changed
ALTER TABLE t ADD offset INT without COLUMN still fails for the listed reserved words. Clause keywords, such as IF NOT EXISTS, also follow ADD.
DROP COLUMN and RENAME COLUMN read the column with KeywordOrIdentifier(), which accepts only a short fixed list of words. That is left to the ALTER column work.
After a comma, ONLY followed by an unquoted identifier is read as the relation prefix. So CREATE TABLE t (a INT, only serial) still fails, and (only serial) or (a INT, only INT) parse.
Validation
KeywordsTest: 1,015 cases.
72 are new. 66 of them cover 22 words in the default, MySQL and PostgreSQL dialects:
a column in CREATE TABLE and in ADD COLUMN;
a CREATE TABLE name;
select list, qualified column, alias, WHERE and ORDER BY;
FROM, UPDATE ... SET and an INSERT column list.
Each case is parsed, deparsed and reparsed, and the AST names are checked. 6 more tests check the AST of the clauses that use these words.
18 cases come from the 9 new non-reserved words in the existing per-keyword tests.
Java 17 offline Gradle spotlessApply check: 10,442 tests, 10,417 passed, 25 skipped, zero failures/errors. The grammar choice conflict check reports no warnings.
About 260 statements around these words were parsed in the default, MySQL and PostgreSQL dialects, and most of them also in the Oracle dialect. They cover the keyword uses (joins, index hints, RETURNING, JSON functions, window frames, Oracle CONNECT BY, PostgreSQL ONLY, EXCLUDE constraints, IF [NOT] EXISTS) and the identifier uses. The statement type and the rendered SQL match master, except for the identifier uses that now parse.
In the keyword sweep, all 1,482 distinct MySQL and 1,179 PostgreSQL statements now parse as CreateTable/Alter, with no UnsupportedStatement left. The path column type statements also parse. The other corpus statements are unchanged.
Performance:
Benchmark: all 321 .sql test resources parsed in the calling thread, thread CPU time, 40 rounds per JVM, 10 alternating JVM pairs against master.
Median best round: 69.6 ms on master and 69.9 ms with this change. Median of the per-run medians: 90.3 ms and 89.8 ms. This change was faster in 4 of 10 pairs.
Lookahead work on the same corpus: token scans +1.3% and syntactic lookahead calls -2.4%.
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 328 PostgreSQL statements give the same result (success, or the same error).
Integration validation
Applied #2806–#2819 together on master (bdf8ac31), with the stacked PRs on top of their bases (#2806 → #2807 → #2808, #2806 → #2809 → #2810 and #2811 → #2812).
Each branch merges cleanly into master. Between the branches, conflicts are limited to adjacent additions (README/index rows, usage sections, imports, visitor and feature lists, one enum line and one alias guard).
The integrated build passes Java 17 offline Gradle spotlessApply check: 11,494 tests, 11,469 passed, 25 skipped, zero failures/errors. The grammar choice conflict check passes.
On a corpus of 635 MySQL 8.4 and PostgreSQL 18 DDL/DCL statements, each accepted by the server, the integrated build parses 265 of 271 MySQL statements (master: 206) and 363 of 364 PostgreSQL statements (master: 328). Every MySQL 8.4 non-reserved word and PostgreSQL 18 unreserved or column-name keyword parses as a column and table name.
On paired MySQL 8.4 and PostgreSQL 18.3 servers, all 263 MySQL and 362 PostgreSQL statements rendered by the integrated build give the same results as the originals.
Open Graph Description: Purpose
Allow keywords that MySQL 8.4 and PostgreSQL 18 accept as unquoted column and table names. A sweep of MySQL's non-reserved words and PostgreSQL's unreserved and column-name keywords...
X Description: Purpose
Allow keywords that MySQL 8.4 and PostgreSQL 18 accept as unquoted column and table names. A sweep of MySQL's non-reserved words and PostgreSQL's unreserved and column-name ...
Opengraph URL: https://github.com/JSQLParser/JSqlParser/pull/2815
X: @github
direct link
Domain: github.com
IPv4 address: 140.82.112.4
| react-profiling | 0 |
| react-import-map | react,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-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f6a3122a-5d7d-a765-e8fa-0e0fef6cf69e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AFBC:2DB625:98D076:D4AC75:6B0484F6 |
| html-safe-nonce | 5d1772e4e5ff7a832beb5c451ceac79485a727f60eda4b48a4651fe54b1e5777 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkJDOjJEQjYyNTo5OEQwNzY6RDRBQzc1OjZCMDQ4NEY2IiwidmlzaXRvcl9pZCI6IjcwNTM2NDY1ODAzODUzNTA5MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3af66972ee2a7f17a1c8634022ccffcef6c1fbcda0e2390063c5be1911d59306 |
| hovercard-subject-tag | pull_request:4854551323 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/JSQLParser/JSqlParser/pull/2815/files |
| twitter:image | https://avatars.githubusercontent.com/u/55116920?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/55116920?s=400&v=4 |
| og:image:alt | Purpose
Allow keywords that MySQL 8.4 and PostgreSQL 18 accept as unquoted column and table names. A sweep of MySQL's non-reserved words and PostgreSQL's unreserved and column-name keywords... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1d5c152376e38b7d2e37f3d5179be29a73bee93b85110da28a4eebe1159cdc70 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/JSQLParser/JSqlParser git https://github.com/JSQLParser/JSqlParser.git |
| octolytics-dimension-user_id | 4643847 |
| octolytics-dimension-user_login | JSQLParser |
| octolytics-dimension-repository_id | 1944709 |
| octolytics-dimension-repository_nwo | JSQLParser/JSqlParser |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1944709 |
| octolytics-dimension-repository_network_root_nwo | JSQLParser/JSqlParser |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f5017e8ff4ea25a8011fcf0f2a0e430c60dc86c8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Skip to content | https://github.com/JSQLParser/JSqlParser/pull/2815/files#start-of-content |
| https://github.com/ |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2815%2Ffiles |
| GitHubRepository hosting, code review, and collaboration | https://github.com/platform |
| CopilotAI coding agent for tasks, projects, and automated work | https://github.com/features/copilot |
| ActionsCI/CD and automation | https://github.com/features/actions |
| Code QualityQuality analysis, fixes, and enforcement | https://github.com/features/code-quality |
| CodespacesCloud development environments | https://github.com/features/codespaces |
| Code SecurityVulnerability detection and remediation | https://github.com/security/advanced-security/code-security |
| Secret ProtectionSecret scanning and leak prevention | https://github.com/security/advanced-security/secret-protection |
| All Features | https://github.com/features |
| Documentation | https://docs.github.com/en |
| Training | https://learn.github.com/skills |
| Certifications | https://learn.github.com/credentials |
| Build with Copilot | https://github.com/features/ai |
| Customize Copilot | https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview |
| Integrations | https://github.com/marketplace |
| Trending repos | https://github.com/trending |
| GitHub Sponsors | https://github.com/open-source/sponsors |
| Developer articles | https://github.com/resources/articles |
| ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place. | https://github.blog/changelog/ |
| Enterprises | https://github.com/enterprise |
| Team | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| See all industries | https://github.com/solutions/industry |
| Why GitHub | https://github.com/why-github |
| Customer Stories | https://github.com/customer-stories |
| Business insights | https://github.com/solutions/executive-insights |
| Trust Center | https://github.com/trust-center |
| GitHub Advanced SecurityEnterprise-grade code security | https://github.com/security/advanced-security |
| Copilot for businessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Documentation | https://docs.github.com/en |
| Resource center | https://github.com/resources |
| Blog | https://github.blog/ |
| Events & webinars | https://github.com/resources/events |
| Community Forum | https://github.com/orgs/community/discussions |
| Customer Stories | https://github.com/customer-stories |
| Integrations | https://github.com/marketplace |
| Customer support | https://help.github.com/ |
| Training | https://learn.github.com/skills |
| GitHub Status | https://www.githubstatus.com/ |
| About | https://github.com/about |
| Partners | https://github.com/partners |
| Changelog | https://github.blog/changelog/ |
| GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub. | https://githubuniverse.com/ |
| Pricing | https://github.com/pricing |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2815%2Ffiles |
| Sign up | https://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 |
| Reload | https://github.com/JSQLParser/JSqlParser/pull/2815/files |
| Reload | https://github.com/JSQLParser/JSqlParser/pull/2815/files |
| Reload | https://github.com/JSQLParser/JSqlParser/pull/2815/files |
| JSQLParser | https://github.com/JSQLParser |
| JSqlParser | https://github.com/JSQLParser/JSqlParser |
| Code | https://github.com/JSQLParser/JSqlParser |
| Issues2 (2) | https://github.com/JSQLParser/JSqlParser/issues |
| Pull requests2 (2) | https://github.com/JSQLParser/JSqlParser/pulls |
| Discussions | https://github.com/JSQLParser/JSqlParser/discussions |
| Actions | https://github.com/JSQLParser/JSqlParser/actions |
| Projects | https://github.com/JSQLParser/JSqlParser/projects |
| Wiki | https://github.com/JSQLParser/JSqlParser/wiki |
| Security and quality | https://github.com/JSQLParser/JSqlParser/security |
| Insights | https://github.com/JSQLParser/JSqlParser/insights |
| Sign up for GitHub
| https://github.com/signup?return_to=%2FJSQLParser%2FJSqlParser%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2FJSQLParser%2FJSqlParser%2Fissues%2Fnew%2Fchoose |
| manticore-projects | https://github.com/manticore-projects |
| JSQLParser:master | https://github.com/JSQLParser/JSqlParser/tree/master |
| minleejae:fix/keywords-as-identifiers-20261014 | https://github.com/minleejae/JSqlParser/tree/fix/keywords-as-identifiers-20261014 |
|
Conversation
0
| https://github.com/JSQLParser/JSqlParser/pull/2815 |
|
Commits
1
| https://github.com/JSQLParser/JSqlParser/pull/2815/commits |
|
Checks
19
| https://github.com/JSQLParser/JSqlParser/pull/2815/checks |
|
Files changed
| https://github.com/JSQLParser/JSqlParser/pull/2815/files |
| Please reload this page | https://github.com/JSQLParser/JSqlParser/pull/2815/files |
|
Allow more MySQL and PostgreSQL keywords as unquoted identifiers
| https://github.com/JSQLParser/JSqlParser/pull/2815/files#top |
|
Show all changes
1 commit
| https://github.com/JSQLParser/JSqlParser/pull/2815/files |
|
86fd17f
fix: allow more MySQL and PostgreSQL keywords as unquoted identifiers
minleejae Oct 14, 2026
| https://github.com/JSQLParser/JSqlParser/pull/2815/commits/86fd17f6beef574e7bbb8a15a302620081c66513 |
|
Clear filters
| https://github.com/JSQLParser/JSqlParser/pull/2815/files |
| Please reload this page | https://github.com/JSQLParser/JSqlParser/pull/2815/files |
| Please reload this page | https://github.com/JSQLParser/JSqlParser/pull/2815/files |
|
JSqlParserCC.jjt
| https://github.com/JSQLParser/JSqlParser/pull/2815/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c |
|
keywords.rst
| https://github.com/JSQLParser/JSqlParser/pull/2815/files#diff-4b2ad3acdcffbe3e209bf6213eede936f6440f7b58c0cf23be005565c1d22b3b |
|
KeywordsTest.java
| https://github.com/JSQLParser/JSqlParser/pull/2815/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17 |
| Please reload this page | https://github.com/JSQLParser/JSqlParser/pull/2815/files |
| Please reload this page | https://github.com/JSQLParser/JSqlParser/pull/2815/files |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |
Response headers:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width
URLs of crawlers that visited me.