AWS Redshift Alter Table Add Primary Key
The RazorSQL alter table tool includes an Add Primary Key option for adding foreign keys to Amazon Redshift database tables. The add primary key function lists all of the columns of the table and allows the user to choose one or more columns to add to the primary key for the table. It also lists the other tables available on the database so that the user can choose a referenced table and referenced column or columns.
Listed below is an example of the DDL generated by the Redshift Alter Table Add Primary Key function:
ALTER TABLE sample.public.department ADD PRIMARY KEY (dnumber)
Below is a screen shot of the add primary key option for the Redshift alter table tool.