Postgresql UNIQUE Index

CREATE UNIQUE INDEX index_name
ON table_name(column_name, [...]);

example

CREATE UNIQUE INDEX unique_index_article_ex_article_id_user_id
ON article_exs(article_id, user_id);