【发布时间】:2015-01-22 07:29:57
【问题描述】:
需要帮助
如何列出任何数据库中面向列的表?
如何列出在任何数据库中使用分区创建的表?
谢谢
【问题讨论】:
需要帮助
如何列出任何数据库中面向列的表?
如何列出在任何数据库中使用分区创建的表?
谢谢
【问题讨论】:
在 Greenplum 中,您不能发出跨数据库查询,并且由于目录放置在每个数据库中,因此您不能同时列出“所有”数据库中的表。但是对于每个数据库,您都可以使用以下查询轻松完成:
-- List all the column-oriented tables in current database
select n.nspname as schemaname,
c.relname as tablename
from pg_class as c, pg_namespace as n
where c.relnamespace = n.oid
and c.relstorage = 'c';
-- List all partitioned tables in current database
select schemaname,
tablename,
count(*) as num_partitions
from pg_partitions
group by 1, 2;
【讨论】:
也会有帮助
select relname from pg_class where reloptions= '{appendonly=true,orientation=column}';
select * from pg_partitions;
谢谢
【讨论】: