postgres ALTER table column with unique in code example Example: postgresql update to unique ALTER TABLE foo ADD UNIQUE (thecolumn);