Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 22A824765DC for ; Fri, 17 May 2002 13:37:16 -0400 (EDT) Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id 4AD2A475ABC for ; Fri, 17 May 2002 12:59:45 -0400 (EDT) Received: from [63.195.55.98] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.9) with HTTP id 1462528; Thu, 16 May 2002 21:40:59 -0700 From: "Josh Berkus" Subject: Re: Constraint problem To: Stephan Szabo , Josh Berkus Cc: X-Mailer: CommuniGate Pro Web Mailer v.3.5.9 Date: Thu, 16 May 2002 21:40:59 -0700 Message-ID: In-Reply-To: <20020516175335.N1443-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200205/185 X-Sequence-Number: 7820 Stephan, > AFAIK we don't actually have statement triggers right now, anyway, > but... > Actually, I guess an after trigger that just checked the new values > would > work as well, right? See if there exists more than one row with the > new > key value. The after trigger should fire after all the changes are > done > and in the worst case you could use constraint triggers and > deferment. > The hard part about this really is making it work with concurrent > modifications, and if you're willing to forgo that, it shouldn't be > too > bad. Thanks. I'll give your solution a try and see what the performance hit is. Is the Unique Constraint issue on the To-Do list? Chris: The "holding value" solution won't work for me. I'm usually changing dozens of values at a time, and they need to stay in the same sequence while blocks of them move on the scale. FYI, I'm implementing Joe Celko's "Linear Nested Set Model" of tree structures. -Josh Berkus