当前位置:网站首页>GBase 8c系统表信息函数(三)
GBase 8c系统表信息函数(三)
2022-07-24 00:16:00 【大壮十二】
- pg_get_function_result(func_oid)
描述:获取函数的RETURNS子句。
返回类型:text
备注:pg_get_function_result为函数返回适当的RETURNS子句。
- pg_get_indexdef(index_oid)
描述:获取索引的CREATE INDEX命令。
返回类型:text
示例:
gbase=# select * from pg_get_indexdef(16416);
pg_get_indexdef
-------------------------------------------------------------------------
CREATE INDEX test3_b_idx ON test3 USING btree (b) TABLESPACE pg_default
(1 row)
- pg_get_indexdef(index_oid, dump_schema_only)
描述:获取索引的CREATE INDEX命令,仅用于dump场景。对于包含local索引的间隔分区表,当dump_schema_only为true时,返回的创建索引语句中不包含自动创建的分区的local索引信息;当dump_schema_only为false时,返回的创建索引语句中包含自动创建的分区的local索引信息。对于非间隔分区表或者不包含local索引的间隔分区分区表,dump_schema_only参数取值不影响函数返回结果。
返回类型:text
示例:
gbase=# CREATE TABLE sales
gbase-# (prod_id NUMBER(6),
gbase(# cust_id NUMBER,
gbase(# time_id DATE,
gbase (# channel_id CHAR(1),
gbase (# promo_id NUMBER(6),
gbase (# quantity_sold NUMBER(3),
gbase (# amount_sold NUMBER(10,2)
gbase (# )
gbase-# PARTITION BY RANGE( time_id) INTERVAL('1 day')
gbase -# (
gbase (# partition p1 VALUES LESS THAN ('2019-02-01 00:00:00'),
gbase (# partition p2 VALUES LESS THAN ('2019-02-02 00:00:00')
gbase (# );
CREATE TABLE
gbase=# create index index_sales on sales(prod_id) local (PARTITION idx_p1 ,PARTITION idx_p2);
CREATE INDEX
-- 插入数据没有匹配的分区,新创建一个分区,并将数据插入该分区
gbase=# INSERT INTO sales VALUES(1, 12, '2019-02-05 00:00:00', 'a', 1, 1, 1);
INSERT 0 1
gbase=# select oid from pg_class where relname = 'index_sales';
oid
-------
16636
(1 row)
gbase=# select * from pg_get_indexdef(16636, true); pg_get_indexdef
------------------------------------------------------------------------------------------------------------------------------------------------------
CREATE INDEX index_sales ON sales USING ubtree (prod_id) LOCAL(PARTITION idx_p1, PARTITION idx_p2) WITH (storage_type=USTORE) TABLESPACE pg_default
(1 row)
gbase=# select * from pg_get_indexdef(16636, false);
pg_get_indexdef
------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------
CREATE INDEX index_sales ON sales USING ubtree (prod_id) LOCAL(PA
RTITION idx_p1, PARTITION idx_p2, PARTITION sys_p1_prod_id_idx) W
ITH (storage_type=USTORE) TABLESPACE pg_default
(1 row)
边栏推荐
- FPGA - SPI bus control flash (3) including code
- Happiness of progress and growth
- 473-82(40、662、31、98、189)
- YOLOv1
- Delete all data of specified query criteria in Oracle
- 理解多态,让不同的“人”做同一件事情会产生不同的结果
- 深度学习之 9 前馈神经网络 基本概念
- FPGA——SPI总线控制flash(3)含代码
- Copy the customer service wechat, go to wechat to add, and make a call
- NGFW portal authentication experiment
猜你喜欢

Docker builds sonarqube, mysql5.7 environment

mongodb的多数据源配置

Windows software: how to install mysql5.7 and configure environment variables

iNFTnews | 呵护“雪山精灵”,42VERSE“数字生态保护”公益项目即将盛启

Sentinel链路方式流控失效解决

总结谋划明方向 凝心聚力开新局——和数软件对口援疆项目显成效

Why do most people think programming is difficult?

Nacos

盘点为下个牛市做准备的10个新Layer1

OpenFeign设置circuitbreaker=true后Feign的超时时间(readTimeout)失效
随机推荐
子矩阵的和
Cloud native concept
[speech synthesis] tensorflowtts Chinese text to speech
473-82(40、662、31、98、189)
Material return on investment
作为一个程序员,有什么想对新人说的吗?
Super simple training of force deduction and problem brushing
太空射击第08课: 改进的碰撞
【HCIP】MGRE环境下OSPF实验,含多进程双向重发布及OSPF特殊区域
Adaptation scheme of large screen visualization
Problems encountered in pytorch
Deep learning 9 feedforward neural network 2: realize feedforward neural network and model optimization
Redis数据结构
[opencv] - when the parameter type of cv.threshold() function is a number, what does it mean
How to open a low commission account? Is it safe?
今天在家里补觉
【低代码】低代码发展的局限性
logback
inode、软链接、硬链接
[wechat Payment]