How to get the column count of all tables in Redshift

Run the below query to get the column count of all tables in Redshift database.

select table_schema, table_name, count(*) from information_schema.columns 
where table_schema not in ('information_schema', 'pg_catalog')
group by table_schema, table_name
order by table_schema, table_name;
See also  How to use OFFSET in Redshift Database