postgresql - 尝试在 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
系统表中。
解决方案
推荐阅读
- python - 我如何在python中生成一个随机数而不重复数字
- rust - 是否可以在 Rust 中将模式作为函数参数传递?
- c++ - c++ 错误:使用已删除的函数 boost::asio::io_context::io_context
- python - 删除与列表中的键对应的重复字典和排序值
- sql - 违反Oracle约束时,设置默认值?我该怎么做呢?
- javascript - 解析 JSON 的问题 - 以 application/x-www-form-urlencoded 形式发送的 ajax 请求
- c++ - C++ 数组在它应该在的地方不是空的
- c# - IBM MQ.NET 异步发送消息并 Commit()
- matplotlib - Matplotlib.pyplot:在 subplo 上绘制对角线
- cassandra - apache cassandra replication_factor 无法正常工作