Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id D095B4764B7 for ; Thu, 16 May 2002 16:41:59 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 2EC8547632E for ; Thu, 16 May 2002 16:39:18 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 7D0C6D605; Thu, 16 May 2002 13:39:19 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 72BDB5C01; Thu, 16 May 2002 13:39:19 -0700 (PDT) Date: Thu, 16 May 2002 13:39:19 -0700 (PDT) From: Stephan Szabo To: Josh Berkus Cc: Subject: Re: Constraint problem In-Reply-To: <200205161230.23619.josh@agliodbs.com> Message-ID: <20020516132750.P93696-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200205/175 X-Sequence-Number: 7810 On Thu, 16 May 2002, Josh Berkus wrote: > > Stephan, > > > I don't seem to be able to create a UNIQUE constraint as DEFERRABLE. Is > this > > > not supported? > > > > Not currently. > > Hmm ... my workaround didn't work. I need to impose a unique constraint on > an INT column in a table, but make sure that the constraint isn't checked > until the end of an UPDATE statement, so that I can swap values when I need > to. > > How can I do this? I unfortunately can't think of a good workaround. AFAICT, Unique should wait until after all of the updates but our implementation doesn't currently do so. Hopefully someone will have some ideas, because the best I can think of requires an additional full table scan to check uniqueness and the concurrency issues would be a bear.