add primary key constraint to existing column in postgres code example
Example: postgres alter table add primary key
-- To set a column as primary key:
ALTER TABLE distributors ADD PRIMARY KEY (tablename);
-- To set a column as primary key:
ALTER TABLE distributors ADD PRIMARY KEY (tablename);