【问题标题】:ERROR: Specified types or functions (one per INFO message) not supported on Redshift tables错误:Redshift 表不支持指定的类型或函数(每条 INFO 消息一个)
【发布时间】:2018-08-11 16:29:29
【问题描述】:

尝试使用以下查询获取表的元数据:

SET SEARCH_PATH to '$user', 'public', 'myschema';
select schemaname,tablename, col, typ, nn, row_number()
OVER(PARTITION BY col, typ, nn) As row
from 
(
SELECT n.nspname::text AS schemaname, c.relname::text AS tablename, 
a.attname::text AS col, format_type(a.atttypid, a.atttypmod)::text AS typ, 
format_encoding(a.attencodingtype::integer)::text AS "encoding", 
a.attisdistkey AS "distkey", a.attsortkeyord AS "sortkey", a.attnotnull AS nn
  FROM pg_namespace n, pg_class c, pg_attribute a
  WHERE n.oid = c.relnamespace AND c.oid = a.attrelid AND a.attnum > 0 AND NOT a.attisdropped AND pg_table_is_visible(c.oid)
  ORDER BY n.nspname, c.relname, a.attnum
) tt
where schemaname = 'myschema' and tablename like 'tbl\\_%';

但我收到错误消息:ERROR: Specified types or functions (one per INFO message) not supported on Redshift tables.

我一直在尝试使用 info 架构视图,但发现最好使用 redshift 特定的 pg_... 视图来避免这些类型的错误,但它们仍在发生。

如何运行此查询而不出现这些错误?

【问题讨论】:

    标签: metadata amazon-redshift pg


    【解决方案1】:

    请查看内置视图svv_table_info 以获取此信息。

    您可能还对我们在 GitHub 上的 Utils 中发布的“Admin Views”感兴趣。

    【讨论】:

      猜你喜欢
      • 2019-12-11
      • 1970-01-01
      • 1970-01-01
      • 2022-01-22
      • 1970-01-01
      • 2020-07-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多