diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_657.sql b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_657.sql index 4f713e190..38342d64d 100644 --- a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_657.sql +++ b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_657.sql @@ -5,7 +5,7 @@ DROP TABLE IF EXISTS pg_catalog.pg_subscription_rel; DROP FUNCTION IF EXISTS pg_catalog.pg_get_replica_identity_index(regclass); -DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_subscription(IN subid oid, OUT subid oid, OUT pid integer, OUT relid oid, OUT received_lsn text, OUT last_msg_send_time timestamp with time zone, OUT last_msg_receipt_time timestamp with time zone, OUT latest_end_lsn text, OUT latest_end_time timestamp with time zone) CASCADE; +DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_subscription(IN subid oid, OUT subid oid, OUT relid oid, OUT pid integer, OUT received_lsn text, OUT last_msg_send_time timestamp with time zone, OUT last_msg_receipt_time timestamp with time zone, OUT latest_end_lsn text, OUT latest_end_time timestamp with time zone) CASCADE; SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 2802; diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_799.sql b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_799.sql index 1b1821124..e485f87e2 100644 --- a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_799.sql +++ b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_799.sql @@ -1,3 +1,6 @@ +DO $upgrade$ +BEGIN +IF working_version_num() < 92608 then DROP FUNCTION IF EXISTS pg_catalog.get_client_info; SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 7732; CREATE OR REPLACE FUNCTION pg_catalog.get_client_info() @@ -7,7 +10,6 @@ CREATE OR REPLACE FUNCTION pg_catalog.get_client_info() AS $function$get_client_info$function$; SET LOCAL inplace_upgrade_next_system_object_oids = IUO_CATALOG, false, true, 0, 0, 0, 0; -DO $$ DECLARE ans boolean; BEGIN @@ -16,10 +18,9 @@ BEGIN drop extension if exists security_plugin cascade; create extension security_plugin; end if; -END$$; +END; ------------------------------------------------------------------------------------------------------------------------------------ -DO $DO$ DECLARE ans boolean; user_name text; @@ -105,7 +106,7 @@ END IF; GRANT SELECT ON pg_catalog.pg_replication_slots TO PUBLIC; ----------------------------------------------------------------------------- -END$DO$; +END; DROP FUNCTION IF EXISTS pg_catalog.gs_undo_meta_dump_zone(int4, boolean) CASCADE; DROP FUNCTION IF EXISTS pg_catalog.gs_undo_meta_dump_spaces(int4, boolean) CASCADE; DROP FUNCTION IF EXISTS pg_catalog.gs_undo_meta_dump_slot(int4, boolean) CASCADE; @@ -114,8 +115,7 @@ DROP FUNCTION IF EXISTS pg_catalog.gs_undo_translot_dump_slot(int4, boolean) CAS DROP FUNCTION IF EXISTS pg_catalog.gs_undo_translot_dump_xid(xid, boolean) CASCADE; DROP FUNCTION IF EXISTS pg_catalog.gs_undo_dump_record(bigint) CASCADE; DROP FUNCTION IF EXISTS pg_catalog.gs_undo_dump_xid(xid) CASCADE; -DROP FUNCTION IF EXISTS pg_catalog.gs_undo_dump_parsepage_mv(text, bigint, text, boolean) CASCADE;DO -$do$ +DROP FUNCTION IF EXISTS pg_catalog.gs_undo_dump_parsepage_mv(text, bigint, text, boolean) CASCADE; DECLARE query_str text; ans boolean; @@ -135,5 +135,6 @@ BEGIN END IF; END IF; END LOOP; -END -$do$; +END; +END IF; +END $upgrade$; diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_657.sql b/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_657.sql index 4f713e190..38342d64d 100644 --- a/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_657.sql +++ b/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_657.sql @@ -5,7 +5,7 @@ DROP TABLE IF EXISTS pg_catalog.pg_subscription_rel; DROP FUNCTION IF EXISTS pg_catalog.pg_get_replica_identity_index(regclass); -DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_subscription(IN subid oid, OUT subid oid, OUT pid integer, OUT relid oid, OUT received_lsn text, OUT last_msg_send_time timestamp with time zone, OUT last_msg_receipt_time timestamp with time zone, OUT latest_end_lsn text, OUT latest_end_time timestamp with time zone) CASCADE; +DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_subscription(IN subid oid, OUT subid oid, OUT relid oid, OUT pid integer, OUT received_lsn text, OUT last_msg_send_time timestamp with time zone, OUT last_msg_receipt_time timestamp with time zone, OUT latest_end_lsn text, OUT latest_end_time timestamp with time zone) CASCADE; SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 2802; diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_799.sql b/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_799.sql index 1b1821124..e485f87e2 100644 --- a/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_799.sql +++ b/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_799.sql @@ -1,3 +1,6 @@ +DO $upgrade$ +BEGIN +IF working_version_num() < 92608 then DROP FUNCTION IF EXISTS pg_catalog.get_client_info; SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 7732; CREATE OR REPLACE FUNCTION pg_catalog.get_client_info() @@ -7,7 +10,6 @@ CREATE OR REPLACE FUNCTION pg_catalog.get_client_info() AS $function$get_client_info$function$; SET LOCAL inplace_upgrade_next_system_object_oids = IUO_CATALOG, false, true, 0, 0, 0, 0; -DO $$ DECLARE ans boolean; BEGIN @@ -16,10 +18,9 @@ BEGIN drop extension if exists security_plugin cascade; create extension security_plugin; end if; -END$$; +END; ------------------------------------------------------------------------------------------------------------------------------------ -DO $DO$ DECLARE ans boolean; user_name text; @@ -105,7 +106,7 @@ END IF; GRANT SELECT ON pg_catalog.pg_replication_slots TO PUBLIC; ----------------------------------------------------------------------------- -END$DO$; +END; DROP FUNCTION IF EXISTS pg_catalog.gs_undo_meta_dump_zone(int4, boolean) CASCADE; DROP FUNCTION IF EXISTS pg_catalog.gs_undo_meta_dump_spaces(int4, boolean) CASCADE; DROP FUNCTION IF EXISTS pg_catalog.gs_undo_meta_dump_slot(int4, boolean) CASCADE; @@ -114,8 +115,7 @@ DROP FUNCTION IF EXISTS pg_catalog.gs_undo_translot_dump_slot(int4, boolean) CAS DROP FUNCTION IF EXISTS pg_catalog.gs_undo_translot_dump_xid(xid, boolean) CASCADE; DROP FUNCTION IF EXISTS pg_catalog.gs_undo_dump_record(bigint) CASCADE; DROP FUNCTION IF EXISTS pg_catalog.gs_undo_dump_xid(xid) CASCADE; -DROP FUNCTION IF EXISTS pg_catalog.gs_undo_dump_parsepage_mv(text, bigint, text, boolean) CASCADE;DO -$do$ +DROP FUNCTION IF EXISTS pg_catalog.gs_undo_dump_parsepage_mv(text, bigint, text, boolean) CASCADE; DECLARE query_str text; ans boolean; @@ -135,5 +135,6 @@ BEGIN END IF; END IF; END LOOP; -END -$do$; +END; +END IF; +END $upgrade$; diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_657.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_657.sql index f97cfebd4..018129456 100644 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_657.sql +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_657.sql @@ -6,7 +6,7 @@ SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 2802; DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_subscription(IN subid oid, OUT subid oid, OUT pid integer, OUT received_lsn text, OUT last_msg_send_time timestamp with time zone, OUT last_msg_receipt_time timestamp with time zone, OUT latest_end_lsn text, OUT latest_end_time timestamp with time zone) CASCADE; -CREATE FUNCTION pg_catalog.pg_stat_get_subscription(IN subid oid, OUT subid oid, OUT pid integer, OUT relid oid, OUT received_lsn text, OUT last_msg_send_time timestamp with time zone, OUT last_msg_receipt_time timestamp with time zone, OUT latest_end_lsn text, OUT latest_end_time timestamp with time zone) RETURNS record LANGUAGE INTERNAL STABLE AS 'pg_stat_get_subscription'; +CREATE FUNCTION pg_catalog.pg_stat_get_subscription(IN subid oid, OUT subid oid, OUT relid oid, OUT pid integer, OUT received_lsn text, OUT last_msg_send_time timestamp with time zone, OUT last_msg_receipt_time timestamp with time zone, OUT latest_end_lsn text, OUT latest_end_time timestamp with time zone) RETURNS record LANGUAGE INTERNAL STABLE AS 'pg_stat_get_subscription'; DROP VIEW IF EXISTS pg_catalog.pg_stat_subscription CASCADE; diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade_catalog_maindb_92_799.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade_catalog_maindb_92_799.sql index 91e35eee8..3a462da2f 100644 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade_catalog_maindb_92_799.sql +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade_catalog_maindb_92_799.sql @@ -1,3 +1,6 @@ +DO $upgrade$ +BEGIN +IF working_version_num() < 92608 then /*------ add sys fuction gs_undo_meta_dump_zone ------*/ DROP FUNCTION IF EXISTS pg_catalog.gs_undo_meta_dump_zone(int4, boolean, OUT zone_id oid, OUT persist_type oid, OUT insert text, OUT discard text, OUT forcediscard text, OUT lsn text) CASCADE; SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 4433; @@ -58,3 +61,5 @@ CREATE OR REPLACE FUNCTION pg_catalog.gs_undo_dump_parsepage_mv(relpath text, bl STABLE STRICT NOT FENCED NOT SHIPPABLE AS $function$gs_undo_dump_parsepage_mv$function$; comment on function PG_CATALOG.gs_undo_dump_parsepage_mv(relpath text, blkno bigint, reltype text, rmem boolean) is 'parse uheap data page and undo to output file based on given filepath'; +END IF; +END $upgrade$; diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_657.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_657.sql index f97cfebd4..018129456 100644 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_657.sql +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_657.sql @@ -6,7 +6,7 @@ SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 2802; DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_subscription(IN subid oid, OUT subid oid, OUT pid integer, OUT received_lsn text, OUT last_msg_send_time timestamp with time zone, OUT last_msg_receipt_time timestamp with time zone, OUT latest_end_lsn text, OUT latest_end_time timestamp with time zone) CASCADE; -CREATE FUNCTION pg_catalog.pg_stat_get_subscription(IN subid oid, OUT subid oid, OUT pid integer, OUT relid oid, OUT received_lsn text, OUT last_msg_send_time timestamp with time zone, OUT last_msg_receipt_time timestamp with time zone, OUT latest_end_lsn text, OUT latest_end_time timestamp with time zone) RETURNS record LANGUAGE INTERNAL STABLE AS 'pg_stat_get_subscription'; +CREATE FUNCTION pg_catalog.pg_stat_get_subscription(IN subid oid, OUT subid oid, OUT relid oid, OUT pid integer, OUT received_lsn text, OUT last_msg_send_time timestamp with time zone, OUT last_msg_receipt_time timestamp with time zone, OUT latest_end_lsn text, OUT latest_end_time timestamp with time zone) RETURNS record LANGUAGE INTERNAL STABLE AS 'pg_stat_get_subscription'; DROP VIEW IF EXISTS pg_catalog.pg_stat_subscription CASCADE; diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade_catalog_otherdb_92_799.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade_catalog_otherdb_92_799.sql index 91e35eee8..3a462da2f 100644 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade_catalog_otherdb_92_799.sql +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade_catalog_otherdb_92_799.sql @@ -1,3 +1,6 @@ +DO $upgrade$ +BEGIN +IF working_version_num() < 92608 then /*------ add sys fuction gs_undo_meta_dump_zone ------*/ DROP FUNCTION IF EXISTS pg_catalog.gs_undo_meta_dump_zone(int4, boolean, OUT zone_id oid, OUT persist_type oid, OUT insert text, OUT discard text, OUT forcediscard text, OUT lsn text) CASCADE; SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 4433; @@ -58,3 +61,5 @@ CREATE OR REPLACE FUNCTION pg_catalog.gs_undo_dump_parsepage_mv(relpath text, bl STABLE STRICT NOT FENCED NOT SHIPPABLE AS $function$gs_undo_dump_parsepage_mv$function$; comment on function PG_CATALOG.gs_undo_dump_parsepage_mv(relpath text, blkno bigint, reltype text, rmem boolean) is 'parse uheap data page and undo to output file based on given filepath'; +END IF; +END $upgrade$;