René's URL Explorer Experiment


Title: Extend PostgreSQL COMMENT ON targets by minleejae · Pull Request #2816 · JSQLParser/JSqlParser · GitHub

Open Graph Title: Extend PostgreSQL COMMENT ON targets by minleejae · Pull Request #2816 · JSQLParser/JSqlParser

X Title: Extend PostgreSQL COMMENT ON targets by minleejae · Pull Request #2816 · JSQLParser/JSqlParser

Description: Purpose Parse the remaining common PostgreSQL COMMENT ON targets. COMMENT ON TRIGGER trg ON users IS '...', as well as POLICY, EXTENSION, DATABASE and ROLE comments, fail in every configuration. Schema dumps and migrations routinely contain these statements. #2639 added eight target kinds; this change covers most of the rest of the PostgreSQL 18 list with the same model. Current design (As-is) CommentTarget models INDEX, SCHEMA, SEQUENCE, DOMAIN, TYPE, MATERIALIZED VIEW, FUNCTION and CONSTRAINT. Each grammar alternative pairs its keyword with its own name parsing. Only CONSTRAINT has an owning relation, and only FUNCTION has a signature. Every other kind fails with a ParseException, for example Encountered: . The shared RoutineReference production reads ORDER as an argument name. Ordered-set aggregate signatures without direct arguments, such as mode(ORDER BY anyelement), therefore fail. This also affects ALTER EXTENSION ... ADD AGGREGATE. Target design (To-be) Extend CommentTarget.Kind instead of adding a parallel model: Within a table: TRIGGER, POLICY and RULE use getName() and getRelation(), like CONSTRAINT. Only CONSTRAINT accepts ON DOMAIN. Routine signatures: PROCEDURE, ROUTINE and AGGREGATE use the shared RoutineReference, like FUNCTION. AGGREGATE requires a signature and accepts (*) and ORDER BY. Casts: CAST (source AS target) exposes getSourceType() and getTargetType(). This is the same shape as the CAST member of ALTER EXTENSION. Named objects: these use getName(). COLLATION, FOREIGN TABLE and STATISTICS, which may be schema-qualified. DATABASE, ROLE, TABLESPACE, ACCESS METHOD, EXTENSION, FOREIGN DATA WRAPPER, SERVER, EVENT TRIGGER, PUBLICATION and SUBSCRIPTION. [PROCEDURAL] LANGUAGE, where isProcedural() records the spelling. Kind.isRoutine() and Kind.isOwnedByRelation() describe the reference shape. The grammar and appendTo() both use them. Grammar: CommentTargetKind() reads the kind words first. CommentTarget() then uses semantic lookahead on the kind to select the reference shape. No new tokens. Kind words without a token, such as ROLE, RULE and SERVER, are matched with isKeywordAhead() and ContextualKeyword(), so they remain identifiers elsewhere. There are no choice conflicts. RoutineReference: skip the direct-argument list when ORDER BY immediately follows (. Traversal: table discovery and StatementVisitorAdapter visit foreign tables and the tables that own triggers, policies and rules, through getReferencedRelation(). Custom deparsers can rewrite these names. Routines, roles, databases and other catalog objects are never reported as tables. Validation: one Feature.commentOn... per new kind, as in #2639. All of them are enabled in the PostgreSQL feature set. PROCEDURE/ROUTINE need PostgreSQL 11, but they stay in the base set, as executeCall already does. Compatibility: the existing kinds keep their rendering, and the public API only gains additions. Not included: OPERATOR [CLASS|FAMILY], TEXT SEARCH ..., CONVERSION, LARGE OBJECT and TRANSFORM. Validation 188 new test cases: CommentTargetTest goes from 74 to 240 and CommentValidatorTest from 10 to 32. They cover: every new kind: parse, then toString and deparser, then reparse, both with Dialect.POSTGRESQL and without a dialect; AST fields: kind; quoted, dotted and Unicode name components; owning relation; signature modes, * and ORDER BY; cast types; PROCEDURAL; table discovery and custom deparser relation rewrites; 21 rejected forms, for example TRIGGER t ON DOMAIN d, PROCEDURE p(*), AGGREGATE a and CAST (integer); kind words used as identifiers; a check that every Kind maps to a validation feature. Java 17 offline Gradle spotlessApply check: 10,543 tests, 10,518 passed, 25 skipped, zero failures/errors. The grammar conflict check, Checkstyle, PMD and SpotBugs pass. Compared with master (bdf8ac31) on a corpus of 635 MySQL 8.4 and PostgreSQL 18 DDL/DCL statements, each accepted by the server, plus variants and keyword cases, with and without a dialect: COMMENT ON TRIGGER/POLICY/EXTENSION/DATABASE/ROLE now parse in both the PostgreSQL dialect and the default mode. Zero regressions and no other status changes. AST dumps of all previously parsed statements are unchanged. 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 332 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 Parse the remaining common PostgreSQL COMMENT ON targets. COMMENT ON TRIGGER trg ON users IS '...', as well as POLICY, EXTENSION, DATABASE and ROLE comments, fail in every configura...

X Description: Purpose Parse the remaining common PostgreSQL COMMENT ON targets. COMMENT ON TRIGGER trg ON users IS '...', as well as POLICY, EXTENSION, DATABASE and ROLE comments, fail in every c...

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

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:48888550-f3bb-8209-359c-2a9d39df54c4
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC8EE:22CC3D:1909D9:219230:6B049746
html-safe-nonce030b6a3d1bd67c636485ca6a4752e02cf32c6be79d552b5011650ef1bda066dc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOEVFOjIyQ0MzRDoxOTA5RDk6MjE5MjMwOjZCMDQ5NzQ2IiwidmlzaXRvcl9pZCI6IjgxMzgwMjMwOTEzMDI2MDI1NjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac71cff8ae299afc6fdec48349d65af6ccae7edad436c831f7ff3ce6933a950c54
hovercard-subject-tagpull_request:4854551898
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/2816/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 the remaining common PostgreSQL COMMENT ON targets. COMMENT ON TRIGGER trg ON users IS '...', as well as POLICY, EXTENSION, DATABASE and ROLE comments, fail in every configura...
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/2816/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2816%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%2F2816%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/2816/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2816/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2816/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-comment-targets-20261014https://github.com/minleejae/JSqlParser/tree/feat/postgresql-comment-targets-20261014
Conversation 0 https://github.com/JSQLParser/JSqlParser/pull/2816
Commits 1 https://github.com/JSQLParser/JSqlParser/pull/2816/commits
Checks 10 https://github.com/JSQLParser/JSqlParser/pull/2816/checks
Files changed https://github.com/JSQLParser/JSqlParser/pull/2816/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2816/files
Extend PostgreSQL COMMENT ON targets https://github.com/JSQLParser/JSqlParser/pull/2816/files#top
Show all changes 1 commit https://github.com/JSQLParser/JSqlParser/pull/2816/files
29dcb3a feat: extend PostgreSQL COMMENT ON targets minleejae Oct 14, 2026 https://github.com/JSQLParser/JSqlParser/pull/2816/commits/29dcb3a34ec70e9ad87b856c09c506936ba4015d
Clear filters https://github.com/JSQLParser/JSqlParser/pull/2816/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2816/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2816/files
Feature.java https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-b57b852438d3e15e4c939656ad6d17f470798c7db7b046f80f164177494076d6
CommentTarget.java https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-90a60695ea87d820850b34618bc07621f1d8d28fcd2546071c7e15076400ca95
PostgresqlVersion.java https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-cd9ef1cda52263743f8e8636a4ca295772665456eff7ad2752635e96837a0590
CommentValidator.java https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-ec0150ed7c3cd8e02faf6ecb0693f0c60972d14df8a155622b3ea27b2bfac08e
JSqlParserCC.jjt https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
usage.rst https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-1d76e581381361db03988ab6bd07be336cb8129b61bda04ab3fe334209488c2c
CommentTargetTest.java https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-c32d0933da1f0fc859ef9fe97089b00ceaa8ec093e3c5634103d4cb571853f30
CommentValidatorTest.java https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-98a08f5add16456db2526d201f8fca4dd0a49363097e644339b01776b55d1eff
src/main/java/net/sf/jsqlparser/parser/feature/Feature.javahttps://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-b57b852438d3e15e4c939656ad6d17f470798c7db7b046f80f164177494076d6
View file https://github.com/minleejae/JSqlParser/blob/29dcb3a34ec70e9ad87b856c09c506936ba4015d/src/main/java/net/sf/jsqlparser/parser/feature/Feature.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2816/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-b57b852438d3e15e4c939656ad6d17f470798c7db7b046f80f164177494076d6
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-b57b852438d3e15e4c939656ad6d17f470798c7db7b046f80f164177494076d6
src/main/java/net/sf/jsqlparser/statement/comment/CommentTarget.javahttps://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-90a60695ea87d820850b34618bc07621f1d8d28fcd2546071c7e15076400ca95
View file https://github.com/minleejae/JSqlParser/blob/29dcb3a34ec70e9ad87b856c09c506936ba4015d/src/main/java/net/sf/jsqlparser/statement/comment/CommentTarget.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2816/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-90a60695ea87d820850b34618bc07621f1d8d28fcd2546071c7e15076400ca95
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-90a60695ea87d820850b34618bc07621f1d8d28fcd2546071c7e15076400ca95
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-90a60695ea87d820850b34618bc07621f1d8d28fcd2546071c7e15076400ca95
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-90a60695ea87d820850b34618bc07621f1d8d28fcd2546071c7e15076400ca95
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-90a60695ea87d820850b34618bc07621f1d8d28fcd2546071c7e15076400ca95
src/main/java/net/sf/jsqlparser/util/validation/feature/PostgresqlVersion.javahttps://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-cd9ef1cda52263743f8e8636a4ca295772665456eff7ad2752635e96837a0590
View file https://github.com/minleejae/JSqlParser/blob/29dcb3a34ec70e9ad87b856c09c506936ba4015d/src/main/java/net/sf/jsqlparser/util/validation/feature/PostgresqlVersion.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2816/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-cd9ef1cda52263743f8e8636a4ca295772665456eff7ad2752635e96837a0590
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-cd9ef1cda52263743f8e8636a4ca295772665456eff7ad2752635e96837a0590
src/main/java/net/sf/jsqlparser/util/validation/validator/CommentValidator.javahttps://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-ec0150ed7c3cd8e02faf6ecb0693f0c60972d14df8a155622b3ea27b2bfac08e
View file https://github.com/minleejae/JSqlParser/blob/29dcb3a34ec70e9ad87b856c09c506936ba4015d/src/main/java/net/sf/jsqlparser/util/validation/validator/CommentValidator.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2816/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-ec0150ed7c3cd8e02faf6ecb0693f0c60972d14df8a155622b3ea27b2bfac08e
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-ec0150ed7c3cd8e02faf6ecb0693f0c60972d14df8a155622b3ea27b2bfac08e
src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjthttps://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
View file https://github.com/minleejae/JSqlParser/blob/29dcb3a34ec70e9ad87b856c09c506936ba4015d/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/2816/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2816/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2816/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2816/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.