Amazon redshift 在红移中检查所有表、列和类型
大家好,我正在努力找到我所有照片的表格、列和类型,不仅仅是红移中的公共照片 例如:存储有关表列的信息:Amazon redshift 在红移中检查所有表、列和类型,amazon-redshift,Amazon Redshift,大家好,我正在努力找到我所有照片的表格、列和类型,不仅仅是红移中的公共照片 例如:存储有关表列的信息: select "column", type, encoding, distkey, sortkey, "notnull" from pg_table_def where tablename = 'lineorder_compound' and sortkey <> 0; column | type | encoding | distkey | sortkey
select "column", type, encoding, distkey, sortkey, "notnull"
from pg_table_def
where tablename = 'lineorder_compound'
and sortkey <> 0;
column | type | encoding | distkey | sortkey | notnull
-------------+---------+----------+---------+---------+--------
lo_orderkey | integer | delta32k | false | 1 | true
lo_custkey | integer | none | false | 2 | true
lo_partkey | integer | none | true | 3 | true
lo_suppkey | integer | delta32k | false | 4 | true
lo_orderdate | integer | delta | false | 5 | true
(5 rows)
选择“列”,类型,编码,distkey,sortkey,“notnull”
从pg_表_def
其中tablename='lineorder\u component'
和sortkey 0;
列|类型|编码| distkey | sortkey | notnull
-------------+---------+----------+---------+---------+--------
lo|u orderkey | integer | delta32k | false | 1 | true
lo|u custkey | integer | none | false | 2 | true
lo|u partkey | integer | none | true | 3 | true
lo|u suppkey | integer | delta32k | false | 4 | true
lo|u orderdate | integer | delta | false | 5 | true
(5排)
@John我已经查看了系统表引用,主要问题是它只能查看基表中的表和列
我只需要拉取从这些表创建的视图,只显示视图中的列,而不是它们所基于的基表。Betsy可能会这样做,但只看到公共模式,她需要运行
将search\u path设置为public、schema1、schema2等。
首先才能在pg\u table\u def
输出中看到其他模式