我是 aws 新手,谁能告诉我 redshifts 与 mysql 命令的等价物是什么?
show tables -- redshift command
describe table_name -- redshift command
所有信息都可以在PG_TABLE_DEF
table, 文档 http://docs.aws.amazon.com/redshift/latest/dg/r_PG_TABLE_DEF.html.
列出a中的所有表public
架构(默认)-show tables
相等的:
SELECT DISTINCT tablename
FROM pg_table_def
WHERE schemaname = 'public'
ORDER BY tablename;
名为的表中所有列的描述表名 - describe table
相等的:
SELECT *
FROM pg_table_def
WHERE tablename = 'table_name'
AND schemaname = 'public';
Update:
正如 @Kishan Pandey 的回答所指出的,如果您正在寻找不同模式的详细信息public
, 你需要set search_path to my_schema
. (show search_path
显示当前搜索路径)
列出表中的my_schema
schema:
set search_path to my_schema;
select * from pg_table_def;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)