Classify all tables

0

I would like to know the type of all tables on Redshift so I think two relevant tables would be svv_table_info and svv_all_tables. However, I can join them to extract the information I need due to the following error:

ERROR: Specified types or functions (one per INFO message) not supported on Redshift tables. Warnings: Column "pgc.relacl" has unsupported type "aclitem[]". Function "array_to_string(anyarray,text)" not supported. Function "has_table_privilege(name,oid,text)" not supported. Function "has_schema_privilege(name,text,text)" not supported.

Can you advise me on this please?

  • Would you share your query?

已提问 1 年前297 查看次数
1 回答
0

Hello,

I understood that you are facing error below :

ERROR: Specified types or functions (one per INFO message) not supported on Redshift tables. Warnings: Column "pgc.relacl" has unsupported type "aclitem[]". Function "array_to_string(anyarray,text)" not supported. Function "has_table_privilege(name,oid,text)" not supported. Function "has_schema_privilege(name,text,text)" not supported.

To help you, please share your query.

Based on the error statement, the expected situation is as follows :

"has_schema_privilege()" is a leader node function. It cannot be executed on compute nodes. The leader node distributes SQL to the compute nodes when a query references user-created tables or system tables (tables with an STL or STV prefix and system views with an SVL or SVV prefix). A query that references only catalog tables (tables with a PG prefix, such as PG_TABLE_DEF) or that does not reference any tables, runs exclusively on the leader node.

If you are trying to run query at system tables with catalog tables, Redshift will attempt to execute the query on compute nodes. Since has_schema_privilege() can't run on compute nodes, you end up hitting the error. This is an expected behavior.

To conclude,It occurs due to how Redshift handles queries [1] where when a query references catalog tables (tables with a PG prefix, such as PG_TABLE_DEF), it runs exclusively on the leader node.

I hope you find the information helpful.

[1] Leader node–only functions - https://docs.aws.amazon.com/redshift/latest/dg/c_SQL_functions_leader_node_only.html

profile pictureAWS
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则