修复2.0.5升级到6.0.0失败问题

This commit is contained in:
chenxiaobin19
2024-03-25 14:38:36 +08:00
committed by yaoxin
parent 8dabf1310d
commit 9aefae0164
6 changed files with 40 additions and 22 deletions

View File

@ -259,7 +259,7 @@ DROP TYPE IF EXISTS pg_catalog.jsonb;
DROP FUNCTION IF EXISTS pg_catalog.gs_decrypt(IN decryptstr text, IN keystr text, IN type text,OUT decrypt_result_str text) CASCADE;
DROP FUNCTION IF EXISTS pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text,OUT encrypt_result_str text) CASCADE;DROP FUNCTION IF EXISTS pg_catalog.gs_decrypt(IN decryptstr text, IN keystr text, IN type text,OUT decrypt_result_str text) CASCADE;
DROP FUNCTION IF EXISTS pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text,OUT encrypt_result_str text) CASCADE;DROP FUNCTION IF EXISTS pg_catalog.gs_decrypt(IN decryptstr text, IN keystr text, IN type text,OUT decrypt_result_str text) CASCADE;
DROP FUNCTION IF EXISTS pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text,OUT encrypt_result_str text) CASCADE;UPDATE pg_catalog.pg_am set amcanunique = FALSE where amname = 'cbtree';
DROP FUNCTION IF EXISTS pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text,OUT encrypt_result_str text) CASCADE;UPDATE pg_catalog.pg_am set amcanunique = FALSE, amhandler = 0 where amname = 'cbtree';
CREATE OR REPLACE VIEW pg_catalog.gs_session_cpu_statistics AS
SELECT
S.datid AS datid,

View File

@ -1,12 +1,21 @@
DROP VIEW IF EXISTS pg_catalog.pg_publication_tables;
CREATE VIEW pg_catalog.pg_publication_tables AS
SELECT
P.pubname AS pubname,
N.nspname AS schemaname,
C.relname AS tablename
FROM pg_publication P, pg_class C
JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE C.oid IN (SELECT relid FROM pg_catalog.pg_get_publication_tables(P.pubname));
do $$DECLARE ans boolean;
BEGIN
for ans in select case when count(*) = 1 then true else false end as ans from (select relname from pg_class where relname = 'pg_publication_tables' and relkind = 'v')
LOOP
if ans = true then -- base version is after 92-507, create older view
DROP VIEW IF EXISTS pg_catalog.pg_publication_tables;
CREATE VIEW pg_catalog.pg_publication_tables AS
SELECT
P.pubname AS pubname,
N.nspname AS schemaname,
C.relname AS tablename
FROM pg_publication P, pg_class C
JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE C.oid IN (SELECT relid FROM pg_catalog.pg_get_publication_tables(P.pubname));
end if;
exit;
END LOOP;
END$$;
-- drop reform info functions
DROP FUNCTION IF EXISTS pg_catalog.query_node_reform_info_from_dms() CASCADE;

View File

@ -259,7 +259,7 @@ DROP TYPE IF EXISTS pg_catalog.jsonb;
DROP FUNCTION IF EXISTS pg_catalog.gs_decrypt(IN decryptstr text, IN keystr text, IN type text,OUT decrypt_result_str text) CASCADE;
DROP FUNCTION IF EXISTS pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text,OUT encrypt_result_str text) CASCADE;DROP FUNCTION IF EXISTS pg_catalog.gs_decrypt(IN decryptstr text, IN keystr text, IN type text,OUT decrypt_result_str text) CASCADE;
DROP FUNCTION IF EXISTS pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text,OUT encrypt_result_str text) CASCADE;DROP FUNCTION IF EXISTS pg_catalog.gs_decrypt(IN decryptstr text, IN keystr text, IN type text,OUT decrypt_result_str text) CASCADE;
DROP FUNCTION IF EXISTS pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text,OUT encrypt_result_str text) CASCADE;UPDATE pg_catalog.pg_am set amcanunique = FALSE where amname = 'cbtree';
DROP FUNCTION IF EXISTS pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text,OUT encrypt_result_str text) CASCADE;UPDATE pg_catalog.pg_am set amcanunique = FALSE, amhandler = 0 where amname = 'cbtree';
CREATE OR REPLACE VIEW pg_catalog.gs_session_cpu_statistics AS
SELECT
S.datid AS datid,

View File

@ -1,12 +1,21 @@
DROP VIEW IF EXISTS pg_catalog.pg_publication_tables;
CREATE VIEW pg_catalog.pg_publication_tables AS
SELECT
P.pubname AS pubname,
N.nspname AS schemaname,
C.relname AS tablename
FROM pg_publication P, pg_class C
JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE C.oid IN (SELECT relid FROM pg_catalog.pg_get_publication_tables(P.pubname));
do $$DECLARE ans boolean;
BEGIN
for ans in select case when count(*) = 1 then true else false end as ans from (select relname from pg_class where relname = 'pg_publication_tables' and relkind = 'v')
LOOP
if ans = true then -- base version is after 92-507, create older view
DROP VIEW IF EXISTS pg_catalog.pg_publication_tables;
CREATE VIEW pg_catalog.pg_publication_tables AS
SELECT
P.pubname AS pubname,
N.nspname AS schemaname,
C.relname AS tablename
FROM pg_publication P, pg_class C
JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE C.oid IN (SELECT relid FROM pg_catalog.pg_get_publication_tables(P.pubname));
end if;
exit;
END LOOP;
END$$;
-- drop reform info functions
DROP FUNCTION IF EXISTS pg_catalog.query_node_reform_info_from_dms() CASCADE;

View File

@ -1402,7 +1402,7 @@ CREATE FUNCTION pg_catalog.gs_decrypt(IN decryptstr text, IN keystr text, IN typ
DROP FUNCTION IF EXISTS pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text,OUT decrypt_result_str text) CASCADE;
SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 6323;
CREATE FUNCTION pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text, OUT encrypt_result_str text) RETURNS text LANGUAGE INTERNAL as 'gs_encrypt';UPDATE pg_catalog.pg_am set amcanunique = TRUE where amname = 'cbtree';
CREATE FUNCTION pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text, OUT encrypt_result_str text) RETURNS text LANGUAGE INTERNAL as 'gs_encrypt';UPDATE pg_catalog.pg_am set amcanunique = TRUE, amhandler = 0 where amname = 'cbtree';
CREATE OR REPLACE VIEW pg_catalog.gs_session_cpu_statistics AS
SELECT
S.datid AS datid,

View File

@ -1402,7 +1402,7 @@ CREATE FUNCTION pg_catalog.gs_decrypt(IN decryptstr text, IN keystr text, IN typ
DROP FUNCTION IF EXISTS pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text,OUT decrypt_result_str text) CASCADE;
SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 6323;
CREATE FUNCTION pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text, OUT encrypt_result_str text) RETURNS text LANGUAGE INTERNAL as 'gs_encrypt';UPDATE pg_catalog.pg_am set amcanunique = TRUE where amname = 'cbtree';
CREATE FUNCTION pg_catalog.gs_encrypt(IN encryptstr text, IN keystr text, IN type text, OUT encrypt_result_str text) RETURNS text LANGUAGE INTERNAL as 'gs_encrypt';UPDATE pg_catalog.pg_am set amcanunique = TRUE, amhandler = 0 where amname = 'cbtree';
CREATE OR REPLACE VIEW pg_catalog.gs_session_cpu_statistics AS
SELECT
S.datid AS datid,