VastbaseG100

基于openGauss内核开发的企业级关系型数据库。

Menu

Vastbase G100 V2.2 Build 5(Patch No.39)

发布日期

2021年12月24日

新特性

SQLServer TOP语法

缺陷修复

1、 【ID1007442】修复了JDBC连接数据库并使用DBLINK执行DELETE、INSERT操作导致宕库的问题

2、 【ID1007555】修复了定时任务dbms_job调用存储过程失败的问题

3、 【ID1007481】修复了DROP INDEX CONCURRENTLY在事务内执行导致宕库的问题

4、 【ID1007108】修复了IPv6测试中集群搭建完后使用vb_ctl query查询信息时,显示的IPv6地址有误,后台日志不断显示“could not bind IPv6 socket”的问题

5、 【ID1007130】修复了IPv6测试中HAS配置文件中仅支持压缩的IPv6且字母为小写的写法,不支持其他合法的IPv6格式的问题

6、 【ID1007167】修复了ALL_TAB_COLS系统视图执行效率慢的问题

7、 【ID1007855】修复了PL/pgSQL 关联数组运行过程中存在内存泄漏的问题

8、 【ID1007793】修复了迁移分区表的主键会报错的问题

9、 【ID1007276】修复了创建插件pgcrypto后短时间内使用内置包DBMS_OBFUSCATION_TOOLKIT的des3encrypt函数对text类型数据加密结果会变化的问题

10、 【ID1006538】修复了用户创建public database link后其他用户无法使用该dblink的问题

11、 【ID1007554】修复了递归查询connect by NOCYCLE prior语法和oracle不一致的问题

12、 【ID1005993】修复了数据库启动时出现warning和failed相关信息的问题

注意事项

1、 针对【ID1007167】修复了ALL_TAB_COLS系统视图执行效率慢的问题,如果使用“替换升级”方式进行升级,需要手动执行以下步骤,并在每个database执行以下SQL:

在数据库配置postgresql.conf中,追加配置参数upgrade_mode=1

重启数据库,使用vsql登录超级管理员,执行以下脚本。完成后去掉upgrade_mode=1,并重启数据库。

START TRANSACTION;
SET search_path TO information_schema;

SET IsInplaceUpgrade = on;

drop VIEW if exists pg_catalog.all_tab_cols;
drop VIEW if exists all_tab_cols;
drop VIEW if exists ora_columns;

SET LOCAL inplace_upgrade_next_system_object_oids=IUO_CATALOG,false,true,7355,0,0,0;

CREATE VIEW ora_columns AS
    SELECT ba.rolname AS table_OWNER,
           nc.nspname AS table_schema,
           c.relname AS table_name,
           a.attname AS column_name,
           a.attnum AS ordinal_position,
           (CASE WHEN a.attgenerated not in ('s') THEN pg_get_expr(ad.adbin, ad.adrelid) END)  AS column_default,
           (CASE WHEN a.attnotnull OR (t.typtype = 'd' AND t.typnotnull) THEN 'NO' ELSE 'YES' END
             )
             AS is_nullable,

           (
             CASE WHEN t.typtype = 'd' THEN
               CASE WHEN bt.typelem <> 0 AND bt.typlen = -1 THEN 'ARRAY'
                    WHEN nbt.nspname = 'pg_catalog' THEN format_type(t.typbasetype, null)
                    ELSE 'USER-DEFINED' END
             ELSE
               CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'ARRAY'
                    WHEN nt.nspname = 'pg_catalog' THEN format_type(a.atttypid, null)
                    ELSE 'USER-DEFINED' END
             END)
             AS data_type,
    
             _pg_char_max_length(_pg_truetypid(a, t), _pg_truetypmod(a, t))
             AS character_maximum_length,
    
             _pg_char_octet_length(_pg_truetypid(a, t), _pg_truetypmod(a, t))
             AS character_octet_length,
    
             _pg_numeric_precision(_pg_truetypid(a, t), _pg_truetypmod(a, t))
             AS numeric_precision,
             _pg_numeric_scale(_pg_truetypid(a, t), _pg_truetypmod(a, t))
             AS numeric_scale,
    
           CAST(null AS character varying) AS character_set_name,
    
       (
             CASE WHEN t.typtype = 'd' THEN
               abt.rolname
             ELSE
               at.rolname
             END)
             AS DATA_TYPE_OWNER,
       a.attlen
    
    FROM (pg_attribute a LEFT JOIN pg_attrdef ad ON attrelid = adrelid AND attnum = adnum)
         JOIN (pg_class c JOIN pg_namespace nc ON (c.relnamespace = nc.oid) LEFT JOIN pg_authid ba on (ba.oid = c.relowner)) ON a.attrelid = c.oid
         JOIN (pg_type t JOIN pg_namespace nt ON (t.typnamespace = nt.oid) LEFT JOIN pg_authid at on (t.typowner = at.oid)) ON a.atttypid = t.oid
         LEFT JOIN (pg_type bt JOIN pg_namespace nbt ON (bt.typnamespace = nbt.oid) LEFT JOIN pg_authid abt on (bt.typowner = abt.oid))
           ON (t.typtype = 'd' AND t.typbasetype = bt.oid)
    
    WHERE (NOT pg_is_other_temp_schema(nc.oid))
          AND a.attnum > 0 AND NOT a.attisdropped AND c.relkind in ('r', 'v', 'f')
          AND (pg_has_role(c.relowner, 'USAGE')
               OR has_column_privilege(c.oid, a.attnum,
                                       'SELECT, INSERT, UPDATE, REFERENCES'));

GRANT SELECT ON ora_columns TO PUBLIC;

CREATE VIEW all_tab_cols AS
    select c.table_OWNER AS OWNER,
        c.table_name AS TABLE_NAME,
        c.column_name AS COLUMN_NAME,
        c.data_type AS DATA_TYPE,
        NULL AS DATA_TYPE_MOD,
        c.DATA_TYPE_OWNER,
        COALESCE(c.character_maximum_length,c.numeric_precision,c.character_octet_length,c.attlen,0) AS DATA_LENGTH,
        c.numeric_precision AS DATA_PRECISION,
        c.numeric_scale AS DATA_SCALE,
        c.is_nullable AS NULLABLE,
        c.ordinal_position AS COLUMN_ID,
        NULL AS DEFAULT_LENGTH,
        c.column_default AS DATA_DEFAULT,
        s.n_distinct AS NUM_DISTINCT,
        NULL AS LOW_VALUE,
        NULL AS HIGH_VALUE,
        CASE WHEN s.n_distinct <> 0 then
            1/s.n_distinct
        ELSE
            NULL
        END
        AS DENSITY,
        NULL AS NUM_NULLS,
        NULL AS NUM_BUCKETS,
        NULL AS LAST_ANALYZED,
        NULL AS SAMPLE_SIZE,
        NULL AS CHARACTER_SET_NAME,
        c.character_octet_length AS CHAR_COL_DECL_LENGTH,
        NULL AS GLOBAL_STATS,
        NULL AS USER_STATS,
        s.avg_width AS AVG_COL_LEN,
        c.character_octet_length AS CHAR_LENGTH,
        NULL AS CHAR_USED,
        NULL AS V80_FMT_IMAGE,
        NULL AS DATA_UPGRADED,
        NULL AS HIDDEN_COLUMN,
        NULL AS VIRTUAL_COLUMN,
        NULL AS SEGMENT_COLUMN_ID,
        c.ordinal_position AS INTERNAL_COLUMN_ID,
        NULL AS HISTOGRAM,
        c.column_name AS QUALIFIED_COL_NAME
    FROM information_schema.ora_columns c
    LEFT JOIN pg_stats s on s.schemaname = c.table_schema and s.tablename = c.table_name and s.attname = c.column_name;

CREATE VIEW pg_catalog.all_tab_cols AS
    select * from all_tab_cols;

SET LOCAL inplace_upgrade_next_system_object_oids=IUO_CATALOG,false,true,0,0,0,0;

commit;
CHECKPOINT;

2、 针对【ID1005993】修复了数据库启动时出现warning和failed相关信息的问题,对部分warning和failed信息,如需避免打印日志,需要手动执行以下步骤:

(1)LOG: [Alarm Module]Get ENV GS_CLUSTER_NAMEE failed!

可将GS_CLUSTER_NAME变量配置成postgresql.conf配置文件中pgxc_node_name的值来避免该日志打印。

(2)WARNING: could not create any HA TCP/IP sockets

若数据库为单机模式,可在启动参数中加上“-M normal”来避免该日志打印。

(3)WARNING: No explicit IP is configured for listen_addresses GUC.

可根据监听需要修改配置文件postgresql.conf中listen_addresses的值为具体IP地址来避免该日志打印。例如用数据库所在机器的IP地址替换“*”(需要注意的是,如果机器上有多个网卡,则需要配置多个IP地址)。