Received: from rivest.xdrive.com (xd1.xdrive.com [65.166.147.200]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5ILwta08345; Mon, 18 Jun 2001 17:58:55 -0400 (EDT) (envelope-from x@xman.org) Received: from rivest (rivest [127.0.0.1]) by rivest.xdrive.com (8.11.2/8.11.2) with ESMTP id f5ILvjN06686; Mon, 18 Jun 2001 14:57:50 -0700 Subject: Re: [SQL] Problems ensuring uniqueness? From: Christopher Smith To: Tom Lane Cc: pgsql-sql@postgresql.org, pgsql-jdbc@postgresql.org In-Reply-To: <8896.992900535@sss.pgh.pa.us> References: <992898628.6594.1.camel@rivest.xdrive.com> <8896.992900535@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Mailer: Evolution/0.10.99 (Preview Release) Date: 18 Jun 2001 14:57:45 -0700 Message-Id: <992901470.6585.2.camel@rivest.xdrive.com> Mime-Version: 1.0 X-Archive-Number: 200106/50 X-Sequence-Number: 791 On 18 Jun 2001 17:42:15 -0400, Tom Lane wrote: > Christopher Smith writes: > Um ... surely that should be "if count > 0" ? Or was that just a > transcription error? > > This approach certainly ought to work as desired given the exclusive > lock, so a silly typo seems like a plausible explanation... Sorry, it is indeed a transcription error (sadly). The actual line in question looks like this in Java: boolean answer = resultSetCount.getInt(1) > 0; I accidently transcribed the field offset instead of the comparison constant.... probably should split that up into two lines of code to avoid confusion like this... --Chris