首页 > 解决方案 > 尝试在 redshift 中将 concat 字符串转换为 regclass 时出错

问题描述

我有以下查询:

SELECT obj_description((table_schema || '.' || table_name)::regclass, 'pg_class') AS table_comment
FROM information_schema.tables;

在最新版本的 PostgreSQL 下运行查询按预期工作,我得到了我的表注释。但是,当尝试在 Redshift 下运行该查询时,我收到错误消息ERROR: cannot cast type text to regclass。尝试将参数转换为中介(例如::char::regclass)只会更改错误消息中的类型。令人困惑的事情是,public.foo::regclass在 Redshift 下的工作完全符合预期。

只是想看看是否有什么我能做的,或者我是否只是把一些连接放在pg_description系统表中。

标签: postgresqlamazon-redshift

解决方案


推荐阅读