Search code examples
databaseamazon-web-servicesamazon-redshiftsql-workbench-j

list tables in redshift using SQLWorkbench


How do I list tables in redshift ?

I am using SQLWorkbench.

I tried SHOW TABLES; and \dt are not recognized commands.

Any help?


Solution

  • 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