This script returns all schemas, tables and columns within RedShift or Postgres. select table_schema, table_name, ordinal_position as position, column_name, data_type, case when character_maximum_length is not null then character_maximum_length else numeric_precision end as max_length, is_nullable, column_default as default_value from information_schema.columns order by table_schema, table_name, ordinal_position;
Here’s a simple guide on creating a new AWS RedShift Cluster within a personal AWS test environment. Warning, if you’re testing this AWS Service you have to be rigorous with managing the cluster for billing reasons.
A common SQL question is, why does anyone use WHERE 1=1 in their queries? And what does it do? The condition means WHERE TRUE, so it’s just bringing back the same query result as it would without.