Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 16A371337B3E for ; Fri, 4 Feb 2011 03:10:15 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 19722-01 for ; Fri, 4 Feb 2011 07:10:07 +0000 (UTC) X-Greylist: delayed 00:07:21.580711 by SQLgrey-1.7.6 Received: from forward3.mail.yandex.net (forward3.mail.yandex.net [77.88.46.8]) by mail.postgresql.org (Postfix) with ESMTP id 347831337B2F for ; Fri, 4 Feb 2011 03:10:07 -0400 (AST) Received: from web71.yandex.ru (web71.yandex.ru [77.88.46.31]) by forward3.mail.yandex.net (Yandex) with ESMTP id 3214E2518DE5; Fri, 4 Feb 2011 10:02:43 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1296802963; bh=zzkAKFw3lmIrokck4wscpBqZANDMX/IofeyQE6ADZUM=; h=From:To:Cc:In-Reply-To:References:Subject:MIME-Version:Message-Id: Date:Content-Transfer-Encoding:Content-Type; b=vKBjQo0vVukeYAKi3fry5L6a88lwICloPyeiXJc5Qr7NFqRpQyygGoGK7CWh2KsAc tg1+znmJ6m9b7MeDBJUmOPiZ22QVLaMdyaEmHgfOo7BgCNbC+yz/b5b4L2ZSwnrygq je3qAvQsFysoy3HaBe17ClqNflZ+e9uw+1IsiE28= Received: from localhost (localhost.localdomain [127.0.0.1]) by web71.yandex.ru (Yandex) with ESMTP id 2024E2008038; Fri, 4 Feb 2011 10:02:43 +0300 (MSK) Received: from z21-13.opera-mini.net (z21-13.opera-mini.net [82.145.210.172]) by mail.yandex.ru with HTTP; Fri, 04 Feb 2011 10:02:42 +0300 From: msi77 To: gvim Cc: pgsql-sql@postgresql.org In-Reply-To: <4D4ACD57.1090508@gmail.com> References: <4D4ACD57.1090508@gmail.com> Subject: Re: UNIQUE on everything except primary key MIME-Version: 1.0 Message-Id: <448911296802962@web71.yandex.ru> Date: Fri, 04 Feb 2011 10:02:42 +0300 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.925 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=1.553, FREEMAIL_FROM=0.001, FSL_RU_URL=2.271, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: * X-Archive-Number: 201102/9 X-Sequence-Number: 35085 Do all the 10 columns make a natural key? 03.02.2011, 18:44, "gvim" : > 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 > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql