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?

asked a year ago291 views
1 Answer
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
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions