PostgreSQL: Support CREATE FOREIGN TABLE - #2515
Open
fmguerreiro wants to merge 5 commits into
Open
fmguerreiro wants to merge 5 commits into
fmguerreiro wants to merge 5 commits into
Conversation
Table-level OPTIONS reuses the list parser lifted out of CREATE SERVER.
Without parens Display emitted a () the input never had, and a persistence modifier was accepted then dropped. Also covers OPTIONS in the span.
OR ALTER, MULTISET, PERSISTENT and the view params were still accepted and then dropped. The error now points at the modifier rather than the table name.
fmguerreiro
marked this pull request as ready for review
September 16, 2026 06:12
Matching any ParserError would also pass if the guard stopped being reached. LOCAL, SET and the view params were never exercised.
Also says why the or_replace disjunct is kept despite being unreachable today.
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.
Parses
CREATE FOREIGN TABLE [IF NOT EXISTS] name (columns) SERVER server [OPTIONS (...)](docs).Split out of #2317 at @LucaCappelletti94's request. That PR now carries
CREATE FOREIGN DATA WRAPPERonly.Table-level
OPTIONSreuses the list parser pulled out ofparse_pg_create_server, which #2317 also moves; whichever lands second needs a rebase there.Per-column
OPTIONS (...),INHERITS,PARTITION OFandALTER FOREIGN TABLEare out of scope; the rustdoc notes that.Ported from the
pgmold-sqlparserfork.