This is an automated email from the ASF dual-hosted git repository.
gfphoenix78 pushed a commit to branch sync-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-gpbackup.git
The following commit(s) were added to refs/heads/sync-with-upstream by this
push:
new fad286f3 fix(test): Handle plpython3u cleanup for Cloudberry
compatibility (#40)
fad286f3 is described below
commit fad286f33d2ef98500130efe9c786389cf00ec53
Author: Robert Mu <[email protected]>
AuthorDate: Mon Sep 8 10:30:30 2025 +0800
fix(test): Handle plpython3u cleanup for Cloudberry compatibility (#40)
In Cloudberry (based on PostgreSQL 14), CREATE LANGUAGE plpython3u
is implemented as a wrapper around CREATE EXTENSION. This means the
language cannot be dropped directly and requires dropping the
extension instead.
Updated plugin tests to use DROP EXTENSION IF EXISTS plpython3u for
Cloudberry databases while maintaining backward compatibility with
GPDB versions that use DROP PROCEDURAL LANGUAGE.
This resolves test failures where Cloudberry would error with:
"cannot drop language plpython3u because extension plpython3u
requires it"
---
end_to_end/plugin_test.go | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/end_to_end/plugin_test.go b/end_to_end/plugin_test.go
index e2dc2c01..90d5077e 100644
--- a/end_to_end/plugin_test.go
+++ b/end_to_end/plugin_test.go
@@ -137,10 +137,17 @@ var _ = Describe("End to End plugin tests", func() {
defer testhelper.AssertQueryRuns(backupConn,
"DROP ROLE testrole")
- // In GPDB 7+, we use plpython3u because of default
python 3 support.
- plpythonDropStatement := "DROP PROCEDURAL LANGUAGE IF
EXISTS plpythonu;"
- if (backupConn.Version.IsGPDB() &&
backupConn.Version.AtLeast("7")) || backupConn.Version.IsCBDB() {
+ var plpythonDropStatement string
+ if backupConn.Version.IsCBDB() {
+ // In Cloudberry (based on PG 14), CREATE
LANGUAGE is a wrapper around CREATE EXTENSION.
+ // To clean up, we must DROP THE EXTENSION, not
the language itself.
+ plpythonDropStatement = "DROP EXTENSION IF
EXISTS plpython3u;"
+ } else if backupConn.Version.IsGPDB() &&
backupConn.Version.AtLeast("7") {
+ // In GPDB 7+, we use plpython3u because of
default python 3 support.
plpythonDropStatement = "DROP PROCEDURAL
LANGUAGE IF EXISTS plpython3u;"
+ } else {
+ // For older GPDB versions, we still need to
DROP THE LANGUAGE.
+ plpythonDropStatement = "DROP PROCEDURAL
LANGUAGE IF EXISTS plpythonu;"
}
testhelper.AssertQueryRuns(backupConn,
plpythonDropStatement)
defer testhelper.AssertQueryRuns(backupConn,
plpythonDropStatement)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]