I received a list of column names in an excel from another team. To ensure all field column names are valid, I put them into a table
create table dev.fields AS select 'column_a' AS field UNION select 'column_b'...
I then try to join with information_schema.columns
, hoping to filter out those invalid column names
SELECT f.field FROM dev.fields f LEFT JOIN information_schema.columns c ON f.field = c.column_name AND c.table_schema = 'target_schema' WHERE c.column_name IS NULL
However, I received errors as below:
ERROR: 0A000: Specified types or functions (one per INFO message) not supported on Redshift tables. Column "c.column_name" has unsupported type "information_schema.sql_identifier". Column "a.*" has unsupported type "pg_attribute". Column "t.*" has unsupported type "pg_type". Function "format_type(oid,integer)" not supported. Function "format_type(oid,integer)" not supported. Function "has_table_privilege(oid,text)" not supported. Function "has_table_privilege(oid,text)" not supported. Function "has_table_privilege(oid,text)" not supported. Function "has_table_privilege(oid,text)" not supported.
I tried to cast column_name into different types but in vain. Would anyone please advise what’s wrong and how I can achieve this goal?