Skip to content

feat: support PostgreSQL referential action column lists - #2691

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:feat/postgresql-fk-action-columns
Sep 24, 2026
Merged

manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:feat/postgresql-fk-action-columns

Conversation

@minleejae

@minleejae minleejae commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Support PostgreSQL ON DELETE SET NULL/SET DEFAULT (columns) as structured referential-action metadata. This is needed for composite foreign keys where deleting a referenced row should change only part of the referencing key.

Extract one shared action production for the two optional ON clauses. Column REFERENCES and table foreign keys in CREATE/ALTER use it. Column lists on ON UPDATE and incompatible actions are rejected.

Validation:

  • Full Gradle check passed (Java 17), including grammar ambiguity, unit tests, coverage, formatting, Checkstyle, PMD, and SpotBugs.
  • On PostgreSQL 17.11, CREATE and ALTER foreign keys changed only the selected column after deleting the referenced row, for both SET NULL and SET DEFAULT.
  • Added AST, mutation, and parse/deparse regression coverage.

Syntax reference: official documentation.

Additional version-boundary validation: the original, toString, and deparser SQL was executed on PostgreSQL 18.6, including the focused behavioral cases. Reviewed the PostgreSQL 18 grammar. Runtime version numbers above identify the tested binaries; this does not claim support for every statement in those DBMS versions.

Signed-off-by: minleejae <mmj9808@gmail.com>
@manticore-projects
manticore-projects merged commit 17be330 into JSQLParser:master Sep 24, 2026
10 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants