René's URL Explorer Experiment


Title: fix: reuse table constraints for ALTER TABLE ADD in every dialect by minleejae · Pull Request #2847 · JSQLParser/JSqlParser · GitHub

Open Graph Title: fix: reuse table constraints for ALTER TABLE ADD in every dialect by minleejae · Pull Request #2847 · JSQLParser/JSqlParser

X Title: fix: reuse table constraints for ALTER TABLE ADD in every dialect by minleejae · Pull Request #2847 · JSQLParser/JSqlParser

Description: ALTER TABLE ADD parses table constraints with the CREATE TABLE production only for Dialect.MYSQL and Dialect.POSTGRESQL (#2612, #2654). Without either dialect, the generic ALTER branches reject forms that CREATE TABLE accepts in every dialect: ALTER TABLE t ADD CHECK (c > 0) ALTER TABLE t ADD CONSTRAINT ck CHECK (c > 0) NOT VALID ALTER TABLE t ADD FOREIGN KEY (id) REFERENCES parent (id) DEFERRABLE INITIALLY DEFERRED ALTER TABLE t ADD CONSTRAINT pk PRIMARY KEY (id) DEFERRABLE INITIALLY DEFERRED ALTER TABLE t ADD CONSTRAINT ex EXCLUDE USING gist (r WITH &&) An ADD now uses the shared production in every dialect when it contains a form that only that production accepts: an unnamed CHECK, FOREIGN KEY, EXCLUDE, or INITIALLY IMMEDIATE|DEFERRED, NOT VALID or ENFORCED outside a CHECK. Statements that already parsed keep their generic representation, accessors and output. The PostgreSQL-only UNIQUE USING INDEX and NOT NULL constraints still require Dialect.POSTGRESQL. The scan lives in the package-private AlterConstraintLookahead, like RoutineBodyBoundary, so that it adds little to CCJSqlParser. The second commit makes VALIDATE CONSTRAINT a structured RelationAlterAction in every dialect. Outside PostgreSQL it was an UNSPECIFIC expression, so its constraint name was not accessible. Its output is unchanged. Existing parser result classes and public method signatures are retained. Syntax reference: PostgreSQL 18 ALTER TABLE. Validation: AlterAddTableConstraintTest compares CREATE TABLE and ALTER ADD for eight definitions without a dialect and with ANSI_SQL, ORACLE, SQLSERVER and H2, and pins the representation of forms that already parsed. 10 of its 13 cases fail on master. PostgreSqlRelationAlterTest covers VALIDATE CONSTRAINT without the PostgreSQL dialect. Removing the dialect test from the gate instead failed 24 existing tests (Oracle constraint states, USING INDEX, legacy key accessors), so only forms that do not parse today are rerouted. Java 17 Gradle check: 12,091 tests, 0 failures, 25 skipped; grammar ambiguity, formatting (Spotless ratchet against upstream/master), Checkstyle, PMD, SpotBugs and JaCoCo pass. PostgreSQL 18.3: the statements above, VALIDATE CONSTRAINT and the PR's other cases (17 statements) give the same results for the original SQL and for the SQL rendered without a dialect and with Dialect.POSTGRESQL.

Open Graph Description: ALTER TABLE ADD parses table constraints with the CREATE TABLE production only for Dialect.MYSQL and Dialect.POSTGRESQL (#2612, #2654). Without either dialect, the generic ALTER branches reject for...

X Description: ALTER TABLE ADD parses table constraints with the CREATE TABLE production only for Dialect.MYSQL and Dialect.POSTGRESQL (#2612, #2654). Without either dialect, the generic ALTER branches reject for...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4

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:f14eec8e-eaca-eb61-03cb-6fb79fc2f726
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA600:3F5E9C:35D057C:465E212:6B0439CE
html-safe-nonceac8419f68ecce561d396f90420c1639221d7f587572189af4ad2784c39ff38e3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjAwOjNGNUU5QzozNUQwNTdDOjQ2NUUyMTI6NkIwNDM5Q0UiLCJ2aXNpdG9yX2lkIjoiNTY2MjQ1Njc4NzE2NTc4ODYyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac32a5e9d5b7a276afacde986a6136f69b674320ac27dcf2f2a092cc242b4e5cfb
hovercard-subject-tagpull_request:4978031055
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/2847/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:altALTER TABLE ADD parses table constraints with the CREATE TABLE production only for Dialect.MYSQL and Dialect.POSTGRESQL (#2612, #2654). Without either dialect, the generic ALTER branches reject for...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64
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
release06dc448a76fe4751ac1db26524aefa3aa3e889a8
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/JSQLParser/JSqlParser/pull/2847/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2847%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%2F2847%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/2847/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2847/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2847/files
JSQLParserhttps://github.com/JSQLParser
JSqlParserhttps://github.com/JSQLParser/JSqlParser
Codehttps://github.com/JSQLParser/JSqlParser
Issues2 (2)https://github.com/JSQLParser/JSqlParser/issues
Pull requests3 (3)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:fix/alter-add-shared-constraints-20261023https://github.com/minleejae/JSqlParser/tree/fix/alter-add-shared-constraints-20261023
Conversation 1 https://github.com/JSQLParser/JSqlParser/pull/2847
Commits 3 https://github.com/JSQLParser/JSqlParser/pull/2847/commits
Checks 10 https://github.com/JSQLParser/JSqlParser/pull/2847/checks
Files changed https://github.com/JSQLParser/JSqlParser/pull/2847/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2847/files
fix: reuse table constraints for ALTER TABLE ADD in every dialect https://github.com/JSQLParser/JSqlParser/pull/2847/files#top
Show all changes 3 commits https://github.com/JSQLParser/JSqlParser/pull/2847/files
f257070 fix: reuse table constraints for ALTER TABLE ADD in every dialect minleejae Oct 23, 2026 https://github.com/JSQLParser/JSqlParser/pull/2847/commits/f257070f4e2a32f84168a0282a96a9bb7983a077
95dc95b fix: parse VALIDATE CONSTRAINT as a structured action in every dialect minleejae Oct 23, 2026 https://github.com/JSQLParser/JSqlParser/pull/2847/commits/95dc95b8058df8beccfb5e3146d1b10bf8faf073
0d91757 refactor: keep the ALTER constraint lookahead in the grammar minleejae Oct 23, 2026 https://github.com/JSQLParser/JSqlParser/pull/2847/commits/0d91757b67776cd27ed8a85c939aa5c83db9e6a6
Clear filters https://github.com/JSQLParser/JSqlParser/pull/2847/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2847/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2847/files
JSqlParserCC.jjt https://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
AlterAddTableConstraintTest.java https://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-20acebed628c229b0408a5c22c81dde4e199f96c146524015eb94dd8e1de280d
PostgreSqlRelationAlterTest.java https://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-31c12b6b7f14c8b550e5eaa957dcb1d60d6591657e3d837aacdf0ca952d6c4ce
src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjthttps://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
View file https://github.com/minleejae/JSqlParser/blob/0d91757b67776cd27ed8a85c939aa5c83db9e6a6/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/2847/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
src/test/java/net/sf/jsqlparser/statement/alter/AlterAddTableConstraintTest.javahttps://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-20acebed628c229b0408a5c22c81dde4e199f96c146524015eb94dd8e1de280d
View file https://github.com/minleejae/JSqlParser/blob/0d91757b67776cd27ed8a85c939aa5c83db9e6a6/src/test/java/net/sf/jsqlparser/statement/alter/AlterAddTableConstraintTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2847/{{ revealButtonHref }}
src/test/java/net/sf/jsqlparser/statement/alter/PostgreSqlRelationAlterTest.javahttps://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-31c12b6b7f14c8b550e5eaa957dcb1d60d6591657e3d837aacdf0ca952d6c4ce
View file https://github.com/minleejae/JSqlParser/blob/0d91757b67776cd27ed8a85c939aa5c83db9e6a6/src/test/java/net/sf/jsqlparser/statement/alter/PostgreSqlRelationAlterTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2847/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-31c12b6b7f14c8b550e5eaa957dcb1d60d6591657e3d837aacdf0ca952d6c4ce
https://github.com/JSQLParser/JSqlParser/pull/2847/files#diff-31c12b6b7f14c8b550e5eaa957dcb1d60d6591657e3d837aacdf0ca952d6c4ce
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2847/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.