Repository navigation
PostgreSQL: Support DROP and COMMENT ON FOREIGN TABLE - #2746
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2746 +/- ##
==========================================
+ Coverage 82.41% 82.42% +0.01%
==========================================
Files 42 42
Lines 35361 35371 +10
Branches 35361 35371 +10
==========================================
+ Hits 29143 29156 +13
+ Misses 2681 2678 -3
Partials 3537 3537 ☔ 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}");
}
}
LucaCappelletti94
force-pushed
the
upstream/drop-comment-foreign-table
branch
from
October 28, 2026 14:51
5533880 to
14f6259
Compare
LucaCappelletti94
force-pushed
the
upstream/drop-comment-foreign-table
branch
from
October 28, 2026 20:12
14f6259 to
248056b
Compare
Contributor
Author
|
Thanks @s5dsn-eqee for the review, I will be merging this now. cc @alamb |
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