Repository navigation
PostgreSQL: Support ALTER FOREIGN TABLE - #2745
Open
LucaCappelletti94 wants to merge 4 commits into
Open
LucaCappelletti94 wants to merge 4 commits into
LucaCappelletti94 wants to merge 4 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2745 +/- ##
==========================================
+ Coverage 82.52% 82.59% +0.07%
==========================================
Files 42 42
Lines 35533 35603 +70
Branches 35533 35603 +70
==========================================
+ Hits 29323 29408 +85
+ Misses 2675 2667 -8
+ Partials 3535 3528 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
force-pushed
the
upstream/foreign-table-statements
branch
3 times, most recently
from
October 29, 2026 11:55
48eac79 to
3ba4c54
Compare
sabir-akhadov-localstack
approved these changes
Oct 29, 2026
| let key = p.parse_identifier()?; | ||
| let value = p.parse_identifier()?; | ||
| Ok(CreateServerOption { key, value }) | ||
| if p.parse_keyword(Keyword::SET) { |
Contributor
There was a problem hiding this comment.
Non-blocking: PG 16 reads OPTIONS (add 'x') / OPTIONS (set 'x') / OPTIONS (drop 'x') as a plain option named add/set/drop (it gets past the grammar and fails with invalid option "add"), while here the first two fail with Expected: identifier, found: ) and the last becomes DROP 'x'. Treating ADD/SET/DROP as the action only when the next token is not a string literal would match.
LucaCappelletti94
force-pushed
the
upstream/foreign-table-statements
branch
from
October 29, 2026 18:16
3ba4c54 to
9582594
Compare
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.
ALTER FOREIGN TABLEdid not parse, so apg_dump --schema-onlyof any database holding a foreign table stopped at theALTER FOREIGN TABLE public.ft OWNER TO postgresline it writes for each one, withExpected: one of VIEW or TYPE ..., found: FOREIGN.The statement now goes through the
ALTER TABLEpath with a newAlterTableType::Foreign, so the AST still says it was foreign. PostgreSQL's grammar shares the tableOPTIONS ( [ ADD | SET | DROP ] option ['value'] )action andALTER COLUMN ... OPTIONS (...)withALTER TABLE, so both are parsed there asGenericOptions. Each element keeps which ofADD,SETorDROPwas written, because PostgreSQL refusesSETon an option that is not there yet.https://www.postgresql.org/docs/current/sql-alterforeigntable.html