Reference a non primary key in another table in postgresql I have a two columns should references two columns in another table. And those two columns are not primary key. I think I can't use foreign key, because it can only references primary keys.
Postgres supports foreign keys to unique indexes (a primary key is a special case of a unique key). From the documentation


  The referenced columns must be the columns of a non-deferrable unique or primary key constraint in the referenced table