robertmu commented on code in PR #29: URL: https://github.com/apache/cloudberry-gpbackup/pull/29#discussion_r2309446775
########## integration/predata_functions_queries_test.go: ########## @@ -827,7 +827,16 @@ LANGUAGE SQL`) } testhelper.AssertQueryRuns(connectionPool, fmt.Sprintf("CREATE LANGUAGE %su", plpythonString)) - defer testhelper.AssertQueryRuns(connectionPool, fmt.Sprintf("DROP LANGUAGE %su", plpythonString)) + + // In Cloudberry (PG14+), a direct `CREATE LANGUAGE` command for a language + // like plpython3u implicitly links it to its corresponding extension, making + // it a core extension member. Therefore, it must be cleaned up by dropping + // the extension, not the language. + if connectionPool.Version.IsCBDB() { + defer testhelper.AssertQueryRuns(connectionPool, fmt.Sprintf("DROP EXTENSION IF EXISTS %su CASCADE", plpythonString)) Review Comment: Thanks for pointing this out! You're absolutely right that both GPDB 7 and Cloudberry support CREATE EXTENSION plpython3u. However, the key difference is in how CREATE LANGUAGE behaves: - GPDB 7 (PG 12): CREATE LANGUAGE uses pg_pltemplate and creates an independent language object - Cloudberry (PG 14): CREATE LANGUAGE internally creates an extension dependency (since pg_pltemplate was deprecated in PG 13) Since our test specifically uses CREATE LANGUAGE (not CREATE EXTENSION), we need different cleanup strategies. If we were testing CREATE EXTENSION instead, then yes, we could use unified DROP EXTENSION cleanup. The current approach ensures we're testing the actual CREATE LANGUAGE behavior that users would encounter on each platform. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org For additional commands, e-mail: commits-h...@cloudberry.apache.org