diff --git a/CMakeLists.txt b/CMakeLists.txt index ce0ba9dd3..caa9c1f43 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,16 +111,22 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/contrib/dolphin) install(FILES ${CMAKE_SOURCE_DIR}/contrib/dolphin/dolphin.control DESTINATION share/postgresql/extension/ ) - install(FILES ${CMAKE_SOURCE_DIR}/contrib/dolphin/dolphin--1.1.sql + install(FILES ${CMAKE_SOURCE_DIR}/contrib/dolphin/dolphin--2.0.sql DESTINATION share/postgresql/extension/ ) install(FILES ${CMAKE_SOURCE_DIR}/contrib/dolphin/dolphin--1.0.sql DESTINATION share/postgresql/extension/ ) - install(FILES ${CMAKE_SOURCE_DIR}/contrib/dolphin/upgrade_script/dolphin--1.0--1.1.sql + install(FILES ${CMAKE_SOURCE_DIR}/contrib/dolphin/dolphin--1.0--2.0.sql DESTINATION share/postgresql/extension/ ) - install(FILES ${CMAKE_SOURCE_DIR}/contrib/dolphin/rollback_script/dolphin--1.1--1.0.sql + install(FILES ${CMAKE_SOURCE_DIR}/contrib/dolphin/dolphin--2.0--1.0.sql + DESTINATION share/postgresql/extension/ + ) + install(FILES ${CMAKE_SOURCE_DIR}/contrib/dolphin/dolphin--1.1--2.0.sql + DESTINATION share/postgresql/extension/ + ) + install(FILES ${CMAKE_SOURCE_DIR}/contrib/dolphin/dolphin--2.0--1.1.sql DESTINATION share/postgresql/extension/ ) install(FILES ${CMAKE_SOURCE_DIR}/contrib/dolphin/openGauss_expr_dolphin.ir diff --git a/build/script/aarch64_lite_list b/build/script/aarch64_lite_list index 714a2fe9f..3d6e75783 100644 --- a/build/script/aarch64_lite_list +++ b/build/script/aarch64_lite_list @@ -33,10 +33,12 @@ ./share/postgresql/extension/security_plugin.control ./share/postgresql/extension/security_plugin--1.0.sql ./share/postgresql/extension/dolphin.control -./share/postgresql/extension/dolphin--1.1.sql +./share/postgresql/extension/dolphin--2.0.sql ./share/postgresql/extension/dolphin--1.0.sql -./share/postgresql/extension/dolphin--1.0--1.1.sql -./share/postgresql/extension/dolphin--1.1--1.0.sql +./share/postgresql/extension/dolphin--1.0--2.0.sql +./share/postgresql/extension/dolphin--2.0--1.0.sql +./share/postgresql/extension/dolphin--1.1--2.0.sql +./share/postgresql/extension/dolphin--2.0--1.1.sql ./share/postgresql/extension/openGauss_expr_dolphin.ir ./share/postgresql/extension/file_fdw--1.0.sql ./share/postgresql/extension/plpgsql.control diff --git a/build/script/aarch64_opengauss_list b/build/script/aarch64_opengauss_list index fd36832e0..811419bb9 100644 --- a/build/script/aarch64_opengauss_list +++ b/build/script/aarch64_opengauss_list @@ -69,10 +69,12 @@ ./share/postgresql/extension/ndpplugin.control ./share/postgresql/extension/ndpplugin--1.0.sql ./share/postgresql/extension/dolphin.control +./share/postgresql/extension/dolphin--2.0.sql ./share/postgresql/extension/dolphin--1.0.sql -./share/postgresql/extension/dolphin--1.1.sql -./share/postgresql/extension/dolphin--1.0--1.1.sql -./share/postgresql/extension/dolphin--1.1--1.0.sql +./share/postgresql/extension/dolphin--1.0--2.0.sql +./share/postgresql/extension/dolphin--2.0--1.0.sql +./share/postgresql/extension/dolphin--1.1--2.0.sql +./share/postgresql/extension/dolphin--2.0--1.1.sql ./share/postgresql/extension/openGauss_expr_dolphin.ir ./share/postgresql/extension/file_fdw--1.0.sql ./share/postgresql/extension/plpgsql.control diff --git a/build/script/opengauss_release_list_ubuntu_single b/build/script/opengauss_release_list_ubuntu_single index ae6f36ef1..dfd0958b4 100644 --- a/build/script/opengauss_release_list_ubuntu_single +++ b/build/script/opengauss_release_list_ubuntu_single @@ -61,10 +61,12 @@ ./share/postgresql/extension/security_plugin.control ./share/postgresql/extension/security_plugin--1.0.sql ./share/postgresql/extension/dolphin.control +./share/postgresql/extension/dolphin--2.0.sql ./share/postgresql/extension/dolphin--1.0.sql -./share/postgresql/extension/dolphin--1.1.sql -./share/postgresql/extension/dolphin--1.0--1.1.sql -./share/postgresql/extension/dolphin--1.1--1.0.sql +./share/postgresql/extension/dolphin--1.0--2.0.sql +./share/postgresql/extension/dolphin--2.0--1.0.sql +./share/postgresql/extension/dolphin--1.1--2.0.sql +./share/postgresql/extension/dolphin--2.0--1.1.sql ./share/postgresql/extension/openGauss_expr_dolphin.ir ./share/postgresql/extension/file_fdw--1.0.sql ./share/postgresql/extension/plpgsql.control diff --git a/build/script/x86_64_lite_list b/build/script/x86_64_lite_list index 0d1e7d927..62660db0e 100644 --- a/build/script/x86_64_lite_list +++ b/build/script/x86_64_lite_list @@ -33,10 +33,12 @@ ./share/postgresql/extension/security_plugin.control ./share/postgresql/extension/security_plugin--1.0.sql ./share/postgresql/extension/dolphin.control -./share/postgresql/extension/dolphin--1.1.sql +./share/postgresql/extension/dolphin--2.0.sql ./share/postgresql/extension/dolphin--1.0.sql -./share/postgresql/extension/dolphin--1.0--1.1.sql -./share/postgresql/extension/dolphin--1.1--1.0.sql +./share/postgresql/extension/dolphin--1.0--2.0.sql +./share/postgresql/extension/dolphin--2.0--1.0.sql +./share/postgresql/extension/dolphin--1.1--2.0.sql +./share/postgresql/extension/dolphin--2.0--1.1.sql ./share/postgresql/extension/openGauss_expr_dolphin.ir ./share/postgresql/extension/file_fdw--1.0.sql ./share/postgresql/extension/plpgsql.control diff --git a/build/script/x86_64_opengauss_list b/build/script/x86_64_opengauss_list index 5e2f16616..4923cc08a 100644 --- a/build/script/x86_64_opengauss_list +++ b/build/script/x86_64_opengauss_list @@ -69,10 +69,12 @@ ./share/postgresql/extension/ndpplugin.control ./share/postgresql/extension/ndpplugin--1.0.sql ./share/postgresql/extension/dolphin.control +./share/postgresql/extension/dolphin--2.0.sql ./share/postgresql/extension/dolphin--1.0.sql -./share/postgresql/extension/dolphin--1.1.sql -./share/postgresql/extension/dolphin--1.0--1.1.sql -./share/postgresql/extension/dolphin--1.1--1.0.sql +./share/postgresql/extension/dolphin--1.0--2.0.sql +./share/postgresql/extension/dolphin--2.0--1.0.sql +./share/postgresql/extension/dolphin--1.1--2.0.sql +./share/postgresql/extension/dolphin--2.0--1.1.sql ./share/postgresql/extension/openGauss_expr_dolphin.ir ./share/postgresql/extension/file_fdw--1.0.sql ./share/postgresql/extension/plpgsql.control diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_899.sql b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_899.sql index 141615579..f5b87d8e1 100644 --- a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_899.sql +++ b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_899.sql @@ -2,10 +2,47 @@ do $$ DECLARE ans boolean; BEGIN - for ans in select case when count(*)=1 then true else false end as ans from (select extname from pg_extension where extname='dolphin' and extversion = '1.1') + for ans in select case when count(*)=1 then true else false end as ans from (select extname from pg_extension where extname='dolphin') LOOP if ans = true then - ALTER EXTENSION dolphin UPDATE TO '1.0'; + if working_version_num() < 92850 then + ALTER EXTENSION dolphin UPDATE TO '1.0'; + elseif working_version_num() = 92850 then + ALTER EXTENSION dolphin UPDATE TO '1.1'; + else + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.9'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.8'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.7'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.6'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.5'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.4'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.3'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.2'; + EXCEPTION WHEN invalid_parameter_value THEN + END; + END; + END; + END; + END; + END; + END; + END; + end if; end if; exit; END LOOP; diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback-post_catalog_otherdb_92_899.sql b/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback-post_catalog_otherdb_92_899.sql index 141615579..f5b87d8e1 100644 --- a/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback-post_catalog_otherdb_92_899.sql +++ b/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback-post_catalog_otherdb_92_899.sql @@ -2,10 +2,47 @@ do $$ DECLARE ans boolean; BEGIN - for ans in select case when count(*)=1 then true else false end as ans from (select extname from pg_extension where extname='dolphin' and extversion = '1.1') + for ans in select case when count(*)=1 then true else false end as ans from (select extname from pg_extension where extname='dolphin') LOOP if ans = true then - ALTER EXTENSION dolphin UPDATE TO '1.0'; + if working_version_num() < 92850 then + ALTER EXTENSION dolphin UPDATE TO '1.0'; + elseif working_version_num() = 92850 then + ALTER EXTENSION dolphin UPDATE TO '1.1'; + else + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.9'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.8'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.7'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.6'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.5'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.4'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.3'; + EXCEPTION WHEN invalid_parameter_value THEN + BEGIN + ALTER EXTENSION dolphin UPDATE TO '1.2'; + EXCEPTION WHEN invalid_parameter_value THEN + END; + END; + END; + END; + END; + END; + END; + END; + end if; end if; exit; END LOOP; diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_899.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_899.sql index 57c0ffa36..91eec9005 100644 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_899.sql +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_899.sql @@ -2,10 +2,10 @@ do $$ DECLARE ans boolean; BEGIN - for ans in select case when count(*)=1 then true else false end as ans from (select extname from pg_extension where extname='dolphin' and extversion = '1.0') + for ans in select case when count(*)=1 then true else false end as ans from (select extname from pg_extension where extname='dolphin') LOOP if ans = true then - ALTER EXTENSION dolphin UPDATE TO '1.1'; + ALTER EXTENSION dolphin UPDATE TO '2.0'; end if; exit; END LOOP; diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_899.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_899.sql index 57c0ffa36..91eec9005 100644 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_899.sql +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_899.sql @@ -2,10 +2,10 @@ do $$ DECLARE ans boolean; BEGIN - for ans in select case when count(*)=1 then true else false end as ans from (select extname from pg_extension where extname='dolphin' and extversion = '1.0') + for ans in select case when count(*)=1 then true else false end as ans from (select extname from pg_extension where extname='dolphin') LOOP if ans = true then - ALTER EXTENSION dolphin UPDATE TO '1.1'; + ALTER EXTENSION dolphin UPDATE TO '2.0'; end if; exit; END LOOP;