On Sat, Oct 5, 2013 at 3:24 PM, JORGE MALDONADO <jorgemal1...@gmail.com> wrote: > So, let´s say that I have the following simple example table: > > 1. cus_id > 2. cus_name > 3. Other fields . . . > > Where "cus_id" is the primary key. And let´s also say that I want "cus_name" > to be unique. I have the option to create a unique constraint or a unique > index. What would be the best decision and why?
Unique constraint would be the right choice, because you want to constrain the values in the column of your table. The unique index is just a tool the constrain uses to perform its function. This index will be created automatically when you add the constraint. -- Kind regards, Sergey Konoplev PostgreSQL Consultant and DBA http://www.linkedin.com/in/grayhemp +1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979 gray...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql