数据仓库服务 GAUSSDB(DWS)-系统表信息函数:pg_get_indexdef(index_oid, column_no, pretty_bool)

时间:2024-11-28 17:39:01

pg_get_indexdef(index_oid, column_no, pretty_bool)

描述:获取索引的CREATE INDEX命令,或者如果column_no不为零,则只获取一个索引字段的定义。

返回类型:text

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
SELECT * FROM pg_get_indexdef(136035,0,false);
                                                pg_get_indexdef
---------------------------------------------------------------------------------------------------------------
 CREATE INDEX ds_ship_mode_t1_index1 ON tpcds.ship_mode_t1 USING psort (sm_ship_mode_sk) TABLESPACE pg_default
(1 row)
SELECT * FROM pg_get_indexdef(136035,1,false);
 pg_get_indexdef
-----------------
 sm_ship_mode_sk
(1 row)
support.huaweicloud.com/sqlreference-830-dws/dws_06_0341.html