Yes, you can. But if you have non-unique entries on your table, it will fail. Here is the how to add unique constraint on your table. If you're using PostgreSQL 9.x you can follow below instruction.
CREATE UNIQUE INDEX constraint_name ON table_name (columns);