How to list all tables and views in Redshift

Run the below query to return all tables and views of a schema in Redshift database where schemaname is the name of the schema.

select table_name,'TABLE' from information_schema.tables where table_schema= 'schemaname' and table_type='BASE TABLE'
union
select table_name,'VIEW' from information_schema.views where table_schema= 'schemaname';
See also  How to change the distribution style of a table in Redshift database