Skip to content
Advertisement

How to add SUPER column to existing AWS Redshift table?

GOAL

  • I would like to add a Redshift SUPER column to and existing redshift table.
  • I need this to store JSON data there

CODE

This is how Normally I would add a new column.

ALTER TABLE products 
ADD COLUMN created_at NOT NULL;

1. Tried

CREATE TABLE temp_test_persons (
    PersonID int,
    LastName varchar(255),
    FirstName varchar(255),
    Address varchar(255),
    City varchar(255)
);

ALTER TABLE temp_test_persons ADD COLUMN newSuperColumn SUPER NOT NULL; 

Error running query: ALTER TABLE ADD COLUMN defined as NOT NULL must have a non-null default expression

Reviewed Solutions

Advertisement

Answer

ALTER TABLE temp_test_persons 
ADD COLUMN newSuperColumn SUPER;
1 People found this is helpful
Advertisement