Redshift does not allow you to change certain table attributes such as the DISTKEY, SORTKEY or ENCODE of an existing table.
In order to change these attributes safely while running AutoLoad or Sync, you can follow the steps below.

ALTER TABLE test_table RENAME TO old_test_table;
CREATE TABLE new_test_table([new table columns]); -- Specify new attributes
INSERT INTO new_test_table (SELECT * FROM old_test_table);
ALTER TABLE new_test_table RENAME TO test_table;
DROP TABLE old_test_table;

FlyData handles real-time replication for Amazon RDS and Aurora, MySQL and PostgreSQL.

Get set up in minutes. Start uncovering data to make faster, better business decisions today.

No Credit Card Needed!

By using this website you agree to accept our Privacy Policy and Terms & Conditions