UNIQUE on everything except primary key

From: gvim <gvimrc(at)gmail(dot)com>
To: pgsql sql <pgsql-sql(at)postgresql(dot)org>
Subject: UNIQUE on everything except primary key
Date: 2011-02-03 15:44:23
Message-ID: 4D4ACD57.1090508@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have a table with 11 columns and want to eliminate duplication on INSERTs. What's the best method? The obvious solution would be to create a UNIQUE index on everything except the primary key - 'id' - but that's a 10-column index and doesn't sound very efficient. Am I missing something more obvious?

gvim

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Gaab 2011-02-03 15:48:23 Re: UNIQUE on everything except primary key
Previous Message Sabin Coanda 2011-02-03 11:01:21 how control update rows