feat: share PostgreSQL foreign table DDL and FDW options - #2714
Merged
manticore-projects merged 5 commits intoSep 25, 2026
Merged
manticore-projects merged 5 commits into
manticore-projects merged 5 commits into
Conversation
Signed-off-by: minleejae <mmj9808@gmail.com>
Signed-off-by: minleejae <mmj9808@gmail.com>
Contributor
|
Please resolve conflicts. |
Signed-off-by: minleejae <mmj9808@gmail.com>
Signed-off-by: minleejae <mmj9808@gmail.com>
Signed-off-by: minleejae <mmj9808@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PostgreSQL FOREIGN TABLE definitions retained SERVER and OPTIONS as raw tokens, and ALTER/DROP FOREIGN TABLE were unsupported. This reuses CreateTable, column definitions, Alter and Drop while giving foreign server and table/column FDW options explicit AST nodes.
ForeignDataOption is shared by CREATE options and ALTER's implicit ADD, ADD, SET and DROP forms. SERVER stays in the existing TableOption list so replacing legacy string options also removes the previous structured server. AlterForeignDataOptions reuses the existing ALTER action pipeline; DROP FOREIGN TABLE exposes typed multi-target names. Rendering and expression/table traversal share these models without treating foreign servers as local table references.
The ALTER target prefix is shared between toString and the deparser, supports the descendant marker, and emits IF EXISTS before ONLY as PostgreSQL requires. Existing table/column action parsers are reused; remote queries, FDW-specific option validation and internal procedural ASTs are outside this change.
Validation: full Gradle check, including JavaCC ambiguity, unit tests and static analysis. Tests cover CREATE/ALTER/DROP variants, options mutation and deletion, legacy replacement, visitors, boundaries, invalid forms and both output paths. Original/toString/deparser execution and catalog comparison passed for 22 PostgreSQL 18.6 cases using a handler-free local FDW; no external service was contacted. Six additional foreign-table boundary cases and four AST mutations (server replacement, legacy replacement, option DROP and column-option replacement) also passed PostgreSQL execution and catalog comparison.
Sources: CREATE FOREIGN TABLE, ALTER FOREIGN TABLE, DROP FOREIGN TABLE.