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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南