How do I list tables in redshift ?
I am using SQLWorkbench.
I tried SHOW TABLES;
and \\dt
are not recognized commands.
Any help?
On Sql workbench,
Go to Tools -> New DBexplorerWindow
it will load all the tables and click on table name shown the table schema as well
Hope this is helpfull.
You can use this query to get the list of tables
SELECT DISTINCT tablename
FROM pg_table_def
WHERE schemaname = 'public'
ORDER BY tablename;
More info here - http://docs.aws.amazon.com/redshift/latest/dg/c_join_PG_examples.html
This should work.
select datname, nspname, relname, sum(rows) as rows
from pg_class, pg_namespace, pg_database, stv_tbl_perm
where pg_namespace.oid = relnamespace
and pg_class.oid = stv_tbl_perm.id
and pg_database.oid = stv_tbl_perm.db_id
and datname = '**db_name**' and nspname = '**schema_name**'
group by datname, nspname, relname
order by datname, nspname, relname;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.