Repository navigation
PostgreSQL: Support DROP and COMMENT ON FOREIGN TABLE - #2746
Open
LucaCappelletti94 wants to merge 3 commits into
Open
LucaCappelletti94 wants to merge 3 commits into
LucaCappelletti94 wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2746 +/- ##
==========================================
+ Coverage 82.34% 82.36% +0.01%
==========================================
Files 42 42
Lines 35263 35270 +7
Branches 35263 35270 +7
==========================================
+ Hits 29039 29049 +10
+ Misses 2677 2674 -3
Partials 3547 3547 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
s5dsn-eqee
suggested changes
Oct 28, 2026
| Some(self.parse_object_name(false)?) | ||
| } else { | ||
| None | ||
| }; |
Contributor
There was a problem hiding this comment.
PostgreSQL DROP FOREIGN TABLE synopsis, DROP FOREIGN TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ] (no TEMPORARY, PURGE or ON):
https://www.postgresql.org/docs/current/sql-dropforeigntable.html
if object_type == ObjectType::ForeignTable && (temporary || purge || table.is_some()) {
return parser_err!(
"Cannot specify TEMPORARY, PURGE, or ON in DROP FOREIGN TABLE",
loc
);
}
and red tests
#[test]
fn parse_drop_foreign_table_rejects_modifiers() {
for sql in [
"DROP TEMPORARY FOREIGN TABLE ft",
"DROP FOREIGN TABLE ft PURGE",
"DROP FOREIGN TABLE ft ON t",
] {
assert!(all_dialects().parse_sql_statements(sql).is_err(), "{sql}");
}
}
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.
DROP FOREIGN TABLE IF EXISTS ft, other CASCADEandCOMMENT ON FOREIGN TABLE ft IS 'remote orders'failed atFOREIGN. Both now parse, withObjectType::ForeignTableandCommentObject::ForeignTableof their own, because PostgreSQL refusesDROP TABLEandCOMMENT ON TABLEon a foreign table.https://www.postgresql.org/docs/current/sql-dropforeigntable.html
https://www.postgresql.org/docs/current/sql-comment.html