Monday, May 28, 2018

Get All tables in Schema in Amazon Redshift

select datname, nspname, relname
from pg_class, pg_namespace, pg_database
where pg_namespace.oid = relnamespace
and datname ='schema_name_here'
and nspname not in
('information_schema','pg_catalog','pg_toast')
group by datname, nspname, relname
order by datname, nspname, relname
;