增加对 file_fdw 扩展的删除限制,与文档保持一致

This commit is contained in:
laishenghao
2023-05-31 14:48:38 +08:00
parent 276decf641
commit 22660b1548
3 changed files with 14 additions and 0 deletions

View File

@ -116,6 +116,11 @@ static void DropExtensionInListIsSupported(List* objname)
}
}
if (pg_strcasecmp(name, "file_fdw") == 0 && !u_sess->attr.attr_common.IsInplaceUpgrade) {
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("EXTENSION file_fdw does not allow to drop.")));
}
/* Enable DROP operation of the above objects during inplace upgrade or support_extended_features is true */
if (!u_sess->attr.attr_common.IsInplaceUpgrade && !g_instance.attr.attr_common.support_extended_features) {
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("EXTENSION is not yet supported.")));

View File

@ -233,3 +233,8 @@ ERROR: table "test_exists" does not exist
-- drop the database
DROP DATABASE if exists abc123_123ABCxar;
NOTICE: database "abc123_123abcxar" does not exist, skipping
-- drop extension
drop extension file_fdw;
ERROR: EXTENSION file_fdw does not allow to drop.
drop extension file_fdw cascade;
ERROR: EXTENSION file_fdw does not allow to drop.

View File

@ -230,3 +230,7 @@ DROP TABLE test_exists;
-- drop the database
DROP DATABASE if exists abc123_123ABCxar;
-- drop extension
drop extension file_fdw;
drop extension file_fdw cascade;