华为云用户手册

  • current_timestamp 描述:当前日期及时间。 返回值类型:timestamp with time zone 示例: 1 2 3 4 5 SELECT current_timestamp; pg_systimestamp ------------------------------ 2017-09-01 16:58:19.22173+08 (1 row)
  • adddate(date, interval | int) 描述:返回给定日期时间加上指定单位的时间间隔的结果。默认单位(即第二个参数为整型时)为天数。 返回值类型:timestamp 示例: 当入参为text类型时: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 SELECT adddate('2020-11-13', 10); adddate ------------ 2020-11-23 (1 row) SELECT adddate('2020-11-13', interval '1' month); adddate ------------ 2020-12-13 (1 row) SELECT adddate('2020-11-13 12:15:16', interval '1' month); adddate --------------------- 2020-12-13 12:15:16 (1 row) SELECT adddate('2020-11-13', interval '1' minute); adddate --------------------- 2020-11-13 00:01:00 (1 row) 当入参为date类型时: 1 2 3 4 5 6 7 8 9 10 11 SELECT adddate(current_date, 10); adddate ------------ 2021-09-24 (1 row) SELECT adddate(date '2020-11-13', interval '1' month); adddate --------------------- 2020-12-13 00:00:00 (1 row)
  • addtime(timestamp | time | text, interval | text) 描述:返回给定日期/时间加上指定时间间隔的结果。该函数仅8.2.0及以上集群版本支持。 返回值类型:与第一个入参类型相同。 示例: 1 2 3 4 5 SELECT addtime('2020-11-13 01:01:01', '23:59:59'); addtime --------------------- 2020-11-14 01:01:00 (1 row)
  • subdate(date, interval | int) 描述:返回给定日期时间减去指定单位的时间间隔的结果; 默认单位(即第二个参数为整型时)为天数。 返回值类型:timestamp 示例: 当入参为text类型时: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 SELECT subdate('2020-11-13', 10); subdate ------------ 2020-11-03 (1 row) SELECT subdate('2020-11-13', interval '2' month); subdate ------------ 2020-09-13 (1 row) SELECT subdate('2020-11-13 12:15:16', interval '1' month); subdate --------------------- 2020-10-13 12:15:16 (1 row) SELECT subdate('2020-11-13', interval '2' minute); subdate --------------------- 2020-11-12 23:58:00 (1 row) 当入参为date类型时: 1 2 3 4 5 6 7 8 9 10 11 SELECT subdate(current_date, 10); subdate ------------ 2021-09-05 (1 row) SELECT subdate(current_date, interval '1' month); subdate --------------------- 2021-08-15 00:00:00 (1 row)
  • subtime(timestamp | time | text, interval | text) 描述:返回给定日期/时间减去指定时间间隔的结果。该函数仅8.2.0及以上集群版本支持。 返回值类型:与第一个入参类型相同。 示例: 1 2 3 4 5 SELECT subtime('2020-11-13 01:01:01', '23:59:59'); addtime --------------------- 2020-11-12 01:01:02 (1 row)
  • age(timestamp, timestamp) 描述:将两个参数相减,并以年、月、日作为返回值。若相减值为负,则函数返回亦为负。 返回值类型:interval 示例: 1 2 3 4 5 SELECT age(timestamp '2001-04-10', timestamp '1957-06-13'); age ------------------------- 43 years 9 mons 27 days (1 row)
  • 示例 删除视图myView: 1 DROP VIEW myView; 删除视图customer_details_view_v2: 1 DROP VIEW public.customer_details_view_v2; 重建分区表customer_address分区P1的分区索引: DROP TABLE IF EXISTS customer_address; CREATE TABLE customer_address ( ca_address_sk INTEGER NOT NULL , ca_address_id CHARACTER(16) NOT NULL , ca_street_number CHARACTER(10) , ca_street_name CHARACTER varying(60) , ca_street_type CHARACTER(15) , ca_suite_number CHARACTER(10) ) DISTRIBUTE BY HASH (ca_address_sk) PARTITION BY RANGE(ca_address_sk) ( PARTITION P1 VALUES LESS THAN(2450815), PARTITION P2 VALUES LESS THAN(2451179), PARTITION P3 VALUES LESS THAN(2451544), PARTITION P4 VALUES LESS THAN(MAXVALUE) ); CREATE INDEX customer_address_index on customer_address(CA_ADDRESS_SK) LOCAL; REINDEX TABLE customer_address PARTITION P1;
  • 示例 建立一个保存点,然后撤销建立保存点后执行的所有命令的效果: 1 2 3 4 5 6 7 START TRANSACTION; INSERT INTO table1 VALUES (1); SAVEPOINT my_savepoint; INSERT INTO table1 VALUES (2); ROLLBACK TO SAVEPOINT my_savepoint; INSERT INTO table1 VALUES (3); COMMIT; 查询表的内容,会同时看到1和3,不能看到2,因为2被回滚。 建立并随后销毁一个保存点: 1 2 3 4 5 6 START TRANSACTION; INSERT INTO table1 VALUES (3); SAVEPOINT my_savepoint; INSERT INTO table1 VALUES (4); RELEASE SAVEPOINT my_savepoint; COMMIT; 查询表的内容,会同时看到3和4。
  • 注意事项 使用ROLLBACK TO SAVEPOINT回滚到一个保存点。使用RELEASE SAVEPOINT删除一个保存点,但是保留该保存点建立后执行的命令的效果。 保存点只能在一个事务块里面建立。在一个事务里面可以定义多个保存点。 函数、匿名块和存储过程中不支持使用SAVEPOINT语法。 由于节点故障或者通信故障引起的分布式节点线程或进程退出导致的报错,以及由于COPY FROM操作中源数据与目标表的表结构不一致导致的报错,均不能正常回滚到保存点之前,而是整个事务回滚。 SQL标准要求,使用savepoint建立一个同名保存点时,需要自动删除前面那个同名保存点。在GaussDB(DWS)数据库里,将保留旧的保存点,但是在回滚或者释放的时候,只使用最近的那个。释放了新的保存点将导致旧的再次成为ROLLBACK TO SAVEPOINT和RELEASE SAVEPOINT可以访问的保存点。除此之外,SAVEPOINT是完全符合SQL标准的。
  • gs_wlm_node_recover(boolean isForce) 描述:动态资源管理模式下,对CCN管控计数和作业信息进行更新恢复。该函数仅支持管理员执行,通常用于CN实例故障重启后的实例恢复,由集群管理组件(CM)调用,不建议用户直接调用。具体功能如下: CN执行:通知CCN清理该CN执行的作业信息和作业对应的管控计数信息。 CCN执行:重置管控计数信息,并从CN上获取最新的慢车道作业信息。 返回值类型:bool
  • pg_stat_get_wlm_node_resource_info(int4) 描述:显示所有DN资源的汇总信息。 返回值类型:record 函数返回字段如下: 名称 类型 描述 min_mem_util integer DN最小内存使用率。 max_mem_util integer DN最大内存使用率。 min_cpu_util integer DN最小CPU使用率。 max_cpu_util integer DN最大CPU使用率。 min_io_util integer DN最小IO使用率。 max_io_util integer DN最大IO使用率。 phy_usemem_rate integer 物理节点最大内存使用率。
  • pgxc_cgroup_reload_conf(text) 描述:在某个节点上进行cgroup配置文件在线加载。入参为节点的IP地址。 返回值类型:record 函数返回字段如下: 名称 类型 描述 node_name text 实例名称 node_host text 实例所在节点的IP地址 result text cgroup在线加载是否成功 示例: 1 2 3 4 5 6 7 8 9 SELECT * FROM pgxc_cgroup_reload_conf('192.168.178.35'); node_name | node_host | result --------------+----------------+--------- cn_5001 | 192.168.178.35 | success dn_6007_6008 | 192.168.178.35 | success dn_6003_6004 | 192.168.178.35 | success dn_6001_6002 | 192.168.178.35 | success dn_6005_6006 | 192.168.178.35 | success (5 rows)
  • pgxc_cgroup_reload_conf() 描述:在系统所有实例上进行cgroup配置文件在线加载。 返回值类型:record 函数返回字段如下: 名称 类型 描述 node_name text 实例名称 node_host text 实例所在节点的IP地址 result text cgroup在线加载是否成功 示例: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 SELECT * FROM pgxc_cgroup_reload_conf(); node_name | node_host | result --------------+-----------------+--------- dn_6025_6026 | 192.168.178.177 | success dn_6049_6050 | 192.168.179.79 | success dn_6051_6052 | 192.168.179.79 | success dn_6055_6056 | 192.168.179.79 | success dn_6067_6068 | 192.168.181.57 | success dn_6023_6024 | 192.168.178.39 | success dn_6009_6010 | 192.168.181.21 | success dn_6011_6012 | 192.168.181.21 | success dn_6015_6016 | 192.168.181.21 | success dn_6029_6030 | 192.168.178.177 | success dn_6031_6032 | 192.168.178.177 | success dn_6045_6046 | 192.168.179.45 | success cn_5001 | 192.168.178.35 | success cn_5003 | 192.168.178.39 | success dn_6061_6062 | 192.168.181.179 | success cn_5006 | 192.168.179.45 | success cn_5004 | 192.168.178.177 | success cn_5002 | 192.168.181.21 | success cn_5005 | 192.168.178.187 | success dn_6019_6020 | 192.168.178.39 | success dn_6007_6008 | 192.168.178.35 | success dn_6071_6072 | 192.168.181.57 | success dn_6003_6004 | 192.168.178.35 | success dn_6013_6014 | 192.168.181.21 | success dn_6035_6036 | 192.168.178.187 | success dn_6037_6038 | 192.168.178.187 | success dn_6001_6002 | 192.168.178.35 | success dn_6063_6064 | 192.168.181.179 | success dn_6005_6006 | 192.168.178.35 | success dn_6057_6058 | 192.168.181.179 | success dn_6069_6070 | 192.168.181.57 | success dn_6027_6028 | 192.168.178.177 | success dn_6059_6060 | 192.168.181.179 | success dn_6041_6042 | 192.168.179.45 | success dn_6043_6044 | 192.168.179.45 | success dn_6047_6048 | 192.168.179.45 | success dn_6033_6034 | 192.168.178.187 | success dn_6065_6066 | 192.168.181.57 | success dn_6021_6022 | 192.168.178.39 | success dn_6017_6018 | 192.168.178.39 | success dn_6039_6040 | 192.168.178.187 | success dn_6053_6054 | 192.168.179.79 | success (42 rows)
  • gs_wlm_set_queryband_order(cstring,int4) 描述:设置query_band次序。 返回值类型:boolean 函数入参字段如下: 名称 类型 描述 qband cstring query_band键值对 order int4 query_band搜索次序,缺省参数,默认为-1 示例: 1 2 3 4 5 SELECT * FROM gs_wlm_set_queryband_order('a=1',2); gs_wlm_set_queryband_action ----------------------------- t (1 row)
  • gs_cgroup_reload_conf() 描述:在当前实例上进行cgroup配置文件在线加载。 返回值类型:record 函数返回字段如下: 名称 类型 描述 node_name text 实例名称 node_host text 实例所在节点的IP地址 result text cgroup在线加载是否成功 示例: 1 2 3 4 SELECT * FROM gs_cgroup_reload_conf(); node_name | node_host | result -----------+----------------+--------- cn_5001 | 192.168.178.35 | success
  • gs_wlm_get_queryband_action(cstring) 描述:查询query_band关联行为和次序。 返回值类型:record 函数返回字段如下: 名称 类型 描述 qband cstring query_band键值对 respool_id Oid query band关联资源池OID respool text query band关联资源池名 priority text query band关联队队列内优先级 qborder int4 query_band搜索次序 示例: 1 2 3 4 5 SELECT * FROM gs_wlm_get_queryband_action('a=1'); qband | respool_id | respool | priority | qborder -------+------------+---------+----------+--------- a=1 | 16388 | p1 | Medium | -1 (1 row)
  • gs_wlm_set_queryband_action(cstring,cstring,int4) 描述:设置query_band关联行为和次序。 返回值类型:boolean 函数入参字段如下: 名称 类型 描述 qband cstring query_band键值对,长度上限为63个字符。 action cstring query_band关联行为。 order int4 query_band搜索次序,缺省参数,默认为-1。 示例: 1 2 3 4 5 6 7 8 9 10 SELECT * FROM gs_wlm_set_queryband_action('a=1','respool=p1'); gs_wlm_set_queryband_action ----------------------------- t (1 row) SELECT * FROM gs_wlm_set_queryband_action('a=3','respool=p1;priority=rush',1); gs_wlm_set_queryband_action ----------------------------- t (1 row)
  • pgxc_wlm_analyze_schema_space(cstring) 描述:在CN上查询某个逻辑集群下集群整体的Schema空间信息,入参为逻辑集群名称。 返回值类型:record 函数返回字段如下: 名称 类型 描述 schemaname text 模式名 databasename text 数据库名 nodegroup text 节点组名称 total_value bigint 该模式的集群空间总值 avg_value bigint 该模式的各实例空间平均值 skew_percent integer 倾斜率 extend_info text 提供信息包括:单实例空间最大值、单实例空间最小值以及最大最小空间所在的实例名 示例: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 SELECT * FROM pgxc_wlm_analyze_schema_space('group1'); schemaname | databasename | nodegroup | total_value | avg_value | skew_percent | extend_info --------------------+--------------+--------------+-------------+-----------+--------------+----------------------------------------------- pg_catalog | test1 | installation | 56819712 | 9469952 | 0 | min:9469952 datanode1,max:9469952 datanode1 public | postgres | installation | 150495232 | 25082538 | 0 | min:24903680 datanode6,max:25280512 datanode1 pg_toast | test1 | installation | 11157504 | 1859584 | 0 | min:1859584 datanode1,max:1859584 datanode1 cstore | test1 | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 data_redis | postgres | installation | 1966080 | 327680 | 50 | min:0 datanode4,max:655360 datanode1 data_redis | test1 | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 public | test1 | installation | 98304 | 16384 | 0 | min:16384 datanode1,max:16384 datanode1 dbms_om | postgres | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 dbms_job | postgres | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 dbms_om | test1 | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 dbms_job | test1 | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 sys | postgres | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 sys | test1 | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 utl_file | postgres | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 utl_raw | postgres | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 dbms_sql | postgres | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 dbms_output | postgres | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 dbms_random | postgres | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 dbms_lob | postgres | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 information_schema | postgres | installation | 1769472 | 294912 | 0 | min:294912 datanode1,max:294912 datanode1 information_schema | test1 | installation | 1769472 | 294912 | 0 | min:294912 datanode1,max:294912 datanode1 utl_file | test1 | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 dbms_output | test1 | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 dbms_random | test1 | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 utl_raw | test1 | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 dbms_sql | test1 | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 dbms_lob | test1 | installation | 0 | 0 | 0 | min:0 datanode1,max:0 datanode1 pg_catalog | postgres | installation | 75431936 | 12571989 | 3 | min:12124160 datanode4,max:13049856 datanode1 redisuser | postgres | installation | 1884160 | 314026 | 50 | min:16384 datanode4,max:630784 datanode1 pg_toast | postgres | installation | 17154048 | 2859008 | 7 | min:2637824 datanode4,max:3080192 datanode1 cstore | postgres | installation | 15294464 | 2549077 | 5 | min:2408448 datanode1,max:2703360 datanode6 (31 rows)
  • pgxc_wlm_get_schema_space(cstring) 描述:在CN上查询某个逻辑集群下各实例的Schema空间信息,入参为逻辑集群名称。 返回值类型:record 函数返回字段如下: 名称 类型 描述 schemaname text 模式名 schemaid oid 模式OID databasename text 数据库名 databaseid oid 数据库OID nodename text 实例名称 nodegroup text 节点组名称 usedspace bigint 已使用的空间大小 permspace bigint 空间上限值 示例: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 SELECT * FROM pgxc_wlm_get_schema_space('group1'); schemaname | schemaid | databasename | databaseid | nodename | nodegroup | usedspace | permspace --------------------+----------+--------------+------------+--------------+--------------+-----------+----------- pg_catalog | 11 | test1 | 16384 | datanode1 | installation | 9469952 | -1 public | 2200 | postgres | 15253 | datanode1 | installation | 25280512 | -1 pg_toast | 99 | test1 | 16384 | datanode1 | installation | 1859584 | -1 cstore | 100 | test1 | 16384 | datanode1 | installation | 0 | -1 data_redis | 18106 | postgres | 15253 | datanode1 | installation | 655360 | -1 data_redis | 18116 | test1 | 16384 | datanode1 | installation | 0 | -1 public | 2200 | test1 | 16384 | datanode1 | installation | 16384 | -1 dbms_om | 3987 | postgres | 15253 | datanode1 | installation | 0 | -1 dbms_job | 3988 | postgres | 15253 | datanode1 | installation | 0 | -1 dbms_om | 3987 | test1 | 16384 | datanode1 | installation | 0 | -1 dbms_job | 3988 | test1 | 16384 | datanode1 | installation | 0 | -1 sys | 11693 | postgres | 15253 | datanode1 | installation | 0 | -1 sys | 11693 | test1 | 16384 | datanode1 | installation | 0 | -1 utl_file | 14644 | postgres | 15253 | datanode1 | installation | 0 | -1 utl_raw | 14669 | postgres | 15253 | datanode1 | installation | 0 | -1 dbms_sql | 14674 | postgres | 15253 | datanode1 | installation | 0 | -1 dbms_output | 14662 | postgres | 15253 | datanode1 | installation | 0 | -1 dbms_random | 14666 | postgres | 15253 | datanode1 | installation | 0 | -1 dbms_lob | 14701 | postgres | 15253 | datanode1 | installation | 0 | -1 information_schema | 14300 | postgres | 15253 | datanode1 | installation | 294912 | -1 information_schema | 14300 | test1 | 16384 | datanode1 | installation | 294912 | -1 utl_file | 14644 | test1 | 16384 | datanode1 | installation | 0 | -1 dbms_output | 14662 | test1 | 16384 | datanode1 | installation | 0 | -1 dbms_random | 14666 | test1 | 16384 | datanode1 | installation | 0 | -1 utl_raw | 14669 | test1 | 16384 | datanode1 | installation | 0 | -1 dbms_sql | 14674 | test1 | 16384 | datanode1 | installation | 0 | -1 dbms_lob | 14701 | test1 | 16384 | datanode1 | installation | 0 | -1 pg_catalog | 11 | postgres | 15253 | datanode1 | installation | 13049856 | -1 redisuser | 16387 | postgres | 15253 | datanode1 | installation | 630784 | -1 pg_toast | 99 | postgres | 15253 | datanode1 | installation | 3080192 | -1 cstore | 100 | postgres | 15253 | datanode1 | installation | 2408448 | -1 pg_catalog | 11 | test1 | 16384 | datanode2 | installation | 9469952 | -1 public | 2200 | postgres | 15253 | datanode2 | installation | 25214976 | -1 pg_toast | 99 | test1 | 16384 | datanode2 | installation | 1859584 | -1 cstore | 100 | test1 | 16384 | datanode2 | installation | 0 | -1 data_redis | 18106 | postgres | 15253 | datanode2 | installation | 655360 | -1 data_redis | 18116 | test1 | 16384 | datanode2 | installation | 0 | -1 public | 2200 | test1 | 16384 | datanode2 | installation | 16384 | -1 dbms_om | 3987 | postgres | 15253 | datanode2 | installation | 0 | -1 dbms_job | 3988 | postgres | 15253 | datanode2 | installation | 0 | -1 dbms_om | 3987 | test1 | 16384 | datanode2 | installation | 0 | -1 dbms_job | 3988 | test1 | 16384 | datanode2 | installation | 0 | -1
  • gs_update_blocklist_hash_info() 描述:用于作业黑名单信息重建,该函数会从系统表GS_BLOCKLIST_QUERY中读取最新的黑名单信息,并更新表中黑名单信息。 返回值类型:bool 示例: 1 2 3 4 5 SELECT gs_update_blocklist_hash_info(); gs_update_blocklist_hash_info ------------------------------ t (1 row)
  • gs_append_blocklist(unique_sql_id int8) 描述:用于新增作业黑名单。即在系统表GS_BLOCKLIST_QUERY中新增一个黑名单,并更新GS_BLOCKLIST_QUERY中黑名单信息。 返回值类型:bool 示例: 1 2 3 4 5 SELECT gs_append_blocklist(111); gs_append_blocklist -------------------- t (1 row)
  • gs_wlm_rebuild_except_rule_hash() 描述:用于重建当前节点的异常规则内存hash表,异常规则的生效阈值由监控线程实时从内存hash获取,hash异常时可以使用该函数进行rebuild恢复。 返回值类型:bool 示例: 1 2 3 4 5 SELECT gs_wlm_rebuild_except_rule_hash(); gs_wlm_rebuild_except_rule_hash -------------------- t (1 row)
  • pgxc_wlm_readjust_relfilenode_size_table(integer) 描述:空间统计校准函数。 由于校准函数执行时与其余业务之间的事务隔离性,校准函数对其它的正在执行的业务不可见,导致校准函数会漏掉此类业务的空间变化,为避免校准之后出现空间差误,建议用户使用空间校准函数时,应选择空间大小稳定无变化的时候执行校准。 参数:取值范围为0~4,不同的入参值代表不同的校准粒度。 入参为0(默认入参为0):不重建PG_RELFILENODE_SIZE系统表,重新校准用户和schema空间。 入参为1:重建PG_RELFILENODE_SIZE系统表,并且重新校准用户和schema空间。 入参为2:重建PG_RELFILENODE_SIZE系统表。 入参为3:重新校准schema空间。 入参为4:重新校准用户空间。 返回值类型:text 示例: 1 2 3 4 5 SELECT * FROM pgxc_wlm_readjust_relfilenode_size_table(1); result -------------- Exec success (1 row)
  • gs_update_blocklist_hash_info(unique_sql_id int8, is_remove boolean) 描述:用于更新内存中unique_sql_id对应的黑名单信息。 is_remove为true时,表示从系统表GS_BLOCKLIST_QUERY中移除unique_sql_id对应黑名单信息。 is_remove为false时,表示在系统表GS_BLOCKLIST_QUERY中增加unique_sql_id对应黑名单信息。 返回值类型:bool 示例: 1 2 3 4 5 SELECT gs_update_blocklist_hash_info(111, false); gs_update_blocklist_hash_info ------------------------------ t (1 row)
  • gs_remove_blocklist(unique_sql_id int8) 描述:用于从作业黑名单中移除一个作业。即从系统表GS_BLOCKLIST_QUERY中移除一个黑名单,并更新GS_BLOCKLIST_QUERY中黑名单信息。 返回值类型:bool 示例: 1 2 3 4 5 SELECT gs_remove_blocklist(111); gs_append_blocklist -------------------- t (1 row)
  • gs_wlm_readjust_user_space(oid) 描述:用户永久存储空间校准函数。入参为用户oid,入参为0的情况下,会校准所有用户的永久存储空间。 返回值类型:text 示例: 1 2 3 4 5 SELECT gs_wlm_readjust_user_space(0); gs_wlm_readjust_user_space ---------------------------- Exec Success (1 row)
  • pgxc_wlm_readjust_schema_space() 描述:Schema永久存储空间校准函数。 返回值类型:text 示例: 1 2 3 4 5 SELECT pgxc_wlm_readjust_schema_space(); pgxc_wlm_readjust_schema_space -------------------------------- Exec Success (1 row)
  • pgxc_wlm_readjust_relfilenode_size_table() 描述:空间统计校准函数,不重建PG_RELFILENODE_SIZE系统表,重新校准用户和schema空间。 由于校准函数执行时与其余业务之间的事务隔离性,校准函数对其它的正在执行的业务不可见,导致校准函数会漏掉此类业务的空间变化,为避免校准之后出现空间差误,建议用户使用空间校准函数时,应选择空间大小稳定无变化的时候执行校准。 返回值类型:text 示例: 1 2 3 4 5 SELECT pgxc_wlm_readjust_schema_space(); pgxc_wlm_readjust_relfilenode_size_table ----------------------------------------- Exec Success (1 row)
  • gs_increase_except_num(unique_sql_id int8,except_num int4) 描述:作业异常信息记录函数。入参要求必须大于0。调用该函数后会将作业异常次数加except_num,同时将作业最新异常时间更新为当前时间。 返回值类型:bool 示例: 1 2 3 4 5 SELECT gs_increase_except_num(111, 4); gs_increase_except_num ----------------------- t (1 row)
  • gs_increase_except_num(unique_sql_id int8,except_num int4, except_time int8) 描述:作业异常信息记录函数。入参要求必须大于0。调用该函数后会将作业异常次数加except_num,同时将作业最新异常时间更新为except_time,except_time为时间戳,该函数主要用于内部调用。 返回值类型:bool 示例: 1 2 3 4 5 SELECT gs_increase_except_num(111, 4, 714623414421256); gs_increase_except_num ----------------------- t (1 row)
共100000条