更新时间:2026-07-28 GMT+08:00
分享

如何查询表的存储方式?

答:可通过表定义函数pg_get_tabledef()查询,row表示行存。具体查询方式如下所示:

--查询test_1表的存储方式。
gaussdb=# SELECT * FROM pg_get_tabledef('test_1');

                              pg_get_tabledef                              
---------------------------------------------------------------------------
 SET search_path = public;                                                +
 CREATE TABLE test_1 (                                                    +
     a integer                                                            +
 )                                                                        +
 WITH (orientation=row, compression=no, storage_type=USTORE, segment=off);
(1 row)

相关文档