X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 82B36476372 for ; Tue, 6 May 2003 23:01:16 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 38643475CE5 for ; Tue, 6 May 2003 23:00:47 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h4730pU6024136; Tue, 6 May 2003 23:00:51 -0400 (EDT) To: Randall Lucas Cc: Michael Teter , pgsql-sql@postgresql.org Subject: Re: UNIQUE boolean: only one row may be "true" In-reply-to: <19ACA479-7FF3-11D7-A71E-000A957653D6@tercent.net> References: <19ACA479-7FF3-11D7-A71E-000A957653D6@tercent.net> Comments: In-reply-to Randall Lucas message dated "Tue, 06 May 2003 14:46:51 -0400" Date: Tue, 06 May 2003 23:00:51 -0400 Message-ID: <24135.1052276451@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-32.5 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/109 X-Sequence-Number: 13274 Randall Lucas writes: > Do you have any suggestions on how this might > better be implemented? It seems to me that with a partial index, there > is not too much overhead and it doesn't seem too offensively > un-boycecoddean. FWIW, I'd go with the unique partial index too. It's a very efficient solution. But it's not portable :-(. I'd be interested to hear what people would do to solve this problem in bog-standard SQL. regards, tom lane