diff --git a/src/gausskernel/optimizer/commands/dropcmds.cpp b/src/gausskernel/optimizer/commands/dropcmds.cpp index b331e2f8ccd0040de6b2b1f7ffbf4ec59f25fb05..98ace86364eee2998eff2dc308b6d95ebc71d428 100644 --- a/src/gausskernel/optimizer/commands/dropcmds.cpp +++ b/src/gausskernel/optimizer/commands/dropcmds.cpp @@ -91,7 +91,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."))); + } } /* diff --git a/src/test/regress/expected/drop_if_exists.out b/src/test/regress/expected/drop_if_exists.out index 6b3fe60f994156521d8ae119829634b03b0596c6..cb3859c5ced9eec79e1f194cd1f991eb0b420968 100644 --- a/src/test/regress/expected/drop_if_exists.out +++ b/src/test/regress/expected/drop_if_exists.out @@ -132,11 +132,7 @@ 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. +\c regression -- functions DROP FUNCTION test_function_exists(); ERROR: function test_function_exists does not exist diff --git a/src/test/regress/sql/drop_if_exists.sql b/src/test/regress/sql/drop_if_exists.sql index 7fee2a4b33ba561274f6d35a9dcf1fdfe977f82b..1e68cce6b45c605c4d93361b8cb96ff1ee1d1f25 100644 --- a/src/test/regress/sql/drop_if_exists.sql +++ b/src/test/regress/sql/drop_if_exists.sql @@ -145,9 +145,7 @@ 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; +\c regression -- functions DROP FUNCTION test_function_exists();