Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBALlMm33023 for ; Mon, 10 Dec 2001 16:47:26 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 8B9B7D5E9; Mon, 10 Dec 2001 13:47:23 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 814D25BEE; Mon, 10 Dec 2001 13:47:23 -0800 (PST) Date: Mon, 10 Dec 2001 13:47:23 -0800 (PST) From: Stephan Szabo To: Phill Kenoyer Cc: Ian Barwick , Subject: Re: Primary Key Problems In-Reply-To: <20011208040643.GD2913@c0de.net> Message-ID: <20011210134414.P70079-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200112/67 X-Sequence-Number: 2791 On Fri, 7 Dec 2001, Phill Kenoyer wrote: > I took your advice and checked the string size using char_length() and > octet_length(). They are the same. > > octet_length | stock | octet_length | inventory_type | client_id > 5 | 10725 | 4 | used | 60 > 5 | 10725 | 4 | used | 60 > > I do a daily pg_dump of the database and the scheme I posted was from > that. So the primary key is still active. > > I just dont understand how I can have dups in the primary keys, unless > it is a bug. Hmm, what does explain show for your query? I'd wonder if the unique index got corrupted for some reason and so didn't see the first value when the second was inserted. If you search for a specific value and try to force an index scan (use set enable_seqscan=false) do you still get two rows (and does explain in that case show it using the index?)