Friday, January 16, 2015

Amazon Redshift: Show Table DDL SQL script





Redshift as a database is still evolving and every now and then we face issues which is a piece of cake in other mature databases. For example, if you want to get all columns and their data-types in Oracle you would simply write "Describe "



But there is no such thing in Redshift as of now. To circumvent that I wrote following SQL script, which helps in generating table DDL.
Just replace the < TABLE >  and < SCHEMA>  with your table name and Schema