Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 8D21B1337B2F for ; Thu, 3 Feb 2011 11:48:38 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 68880-01 for ; Thu, 3 Feb 2011 15:48:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.scanlab.de (mail.scanlab.de [62.138.55.241]) by mail.postgresql.org (Postfix) with ESMTP id 1161D1337BC2 for ; Thu, 3 Feb 2011 11:48:27 -0400 (AST) Received: from unknown (HELO Exchange-Server.scanlab-intern.de) ([172.16.20.15]) by mail.scanlab-intern.de with ESMTP; 03 Feb 2011 16:48:25 +0100 Received: from Exchange-Server.scanlab-intern.de ([127.0.0.1]) by Exchange-Server ([127.0.0.1]) with mapi; Thu, 3 Feb 2011 16:48:25 +0100 From: Andreas Gaab To: 'gvim' CC: pgsql sql Date: Thu, 3 Feb 2011 16:48:23 +0100 Subject: Re: UNIQUE on everything except primary key Thread-Topic: [SQL] UNIQUE on everything except primary key Thread-Index: AcvDuUfews8NWCHzSF2tjN3TNMNaFwAAHOzw Message-ID: <48DA836F3865C54B8FBF424A3B775AF6671A683922@Exchange-Server> References: <4D4ACD57.1090508@gmail.com> In-Reply-To: <4D4ACD57.1090508@gmail.com> Accept-Language: de-DE Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/5 X-Sequence-Number: 35081 Did you check check constraints? http://www.postgresql.org/docs/8.4/static/ddl-constraints.html Best Andreas -----Urspr=FCngliche Nachricht----- Von: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]= Im Auftrag von gvim Gesendet: Donnerstag, 3. Februar 2011 16:44 An: pgsql sql Betreff: [SQL] UNIQUE on everything except primary key 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 --=20 Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql