!1763 在support_extended_features场景下,支持删除插件

Merge pull request !1763 from pengjiong/drop_ext
This commit is contained in:
opengauss-bot
2022-05-26 11:10:25 +00:00
committed by Gitee
3 changed files with 19 additions and 9 deletions

View File

@ -90,7 +90,10 @@ static void DropExtensionInListIsSupported(List* objname)
}
}
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("EXTENSION is not yet supported.")));
/* 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

@ -132,11 +132,14 @@ DROP EXTENSION test_extension_exists;
ERROR: extension "test_extension_exists" does not exist
DROP EXTENSION IF EXISTS test_extension_exists;
NOTICE: extension "test_extension_exists" does not exist, skipping
-- exists but doesn't support drop
DROP EXTENSION plpgsql;
ERROR: EXTENSION is not yet supported.
DROP EXTENSION IF EXISTS plpgsql;
ERROR: EXTENSION is not yet supported.
-- only extension in white list support drop, but the guc support_extended_features is true in pg_regress mode, so hdfs_fdw can be droped
CREATE DATABASE ext_test_db;
\c ext_test_db
DROP EXTENSION hdfs_fdw;
DROP EXTENSION IF EXISTS hdfs_fdw;
NOTICE: extension "hdfs_fdw" does not exist, skipping
\c regression
DROP DATABASE ext_test_db;
-- functions
DROP FUNCTION test_function_exists();
ERROR: function test_function_exists does not exist

View File

@ -145,9 +145,13 @@ DROP TEXT SEARCH CONFIGURATION test_tsconfig_exists;
-- doesn't exists
DROP EXTENSION test_extension_exists;
DROP EXTENSION IF EXISTS test_extension_exists;
-- exists but doesn't support drop
DROP EXTENSION plpgsql;
DROP EXTENSION IF EXISTS plpgsql;
-- only extension in white list support drop, but the guc support_extended_features is true in pg_regress mode, so hdfs_fdw can be droped
CREATE DATABASE ext_test_db;
\c ext_test_db
DROP EXTENSION hdfs_fdw;
DROP EXTENSION IF EXISTS hdfs_fdw;
\c regression
DROP DATABASE ext_test_db;
-- functions
DROP FUNCTION test_function_exists();