How do I add a column to a redshift table?

Adding columns to existing redshift table

  1. Create the two new columns with NOT NULL and DEFAULT.
  2. Filling the columns with data.
  3. Creating an empty table with the same columns as the target DB. ( Of course the two new columns would be just NOT NULL)
  4. Inserting everything from the target DB to the new DB.
  5. Dropping the target DB.
  6. Renaming the new DB to the target.

Related posts: