X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C66918B9E06; Thu, 3 Feb 2005 16:45:51 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 50109-03; Thu, 3 Feb 2005 16:45:35 +0000 (GMT) Received: from bos-gate3.raytheon.com (bos-gate3.raytheon.com [199.46.198.232]) by svr1.postgresql.org (Postfix) with ESMTP id 9B6BD8B9F5C; Thu, 3 Feb 2005 16:45:34 +0000 (GMT) Received: from ds01e00.directory.ray.com (ds01e00.directory.ray.com [147.25.130.248]) by bos-gate3.raytheon.com (8.12.10/8.12.10) with ESMTP id j13GjTLY005790; Thu, 3 Feb 2005 11:45:33 -0500 (EST) Received: from ds01e00 (localhost [127.0.0.1]) by ds01e00.directory.ray.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id j13GjLKD002289; Thu, 3 Feb 2005 16:45:23 GMT Received: from ds01e00.directory.ray.com with LMTP by ds01e00 (2.0.4/sieved-2-0-build-478); Thu, 3 Feb 2005 16:45:20 +0000 Received: from ds02t01.directory.ray.com (ds02t01.directory.ray.com [147.25.154.118]) by ds01e00.directory.ray.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id j13GfwTA001474 sender Richard_D_Levine@raytheon.com; Thu, 3 Feb 2005 16:42:55 GMT Received: from notesserver5.ftw.us.ray.com (notesserver5.ftw.us.ray.com [151.168.145.35]) by ds02t01.directory.ray.com (8.12.10/8.12.10) with ESMTP id j13GV8HJ015944; Thu, 3 Feb 2005 16:31:08 GMT Subject: Re: pg primary key bug? To: Michael Glaesemann Cc: pginfo , pgsql-sql@postgresql.org, pgsql-sql-owner@postgresql.org X-Mailer: Lotus Notes Release 5.0.8 June 18, 2001 Message-ID: From: Richard_D_Levine@raytheon.com Date: Thu, 3 Feb 2005 11:30:56 -0500 X-MIMETrack: Serialize by Router on NotesServer5/HDC(Release 6.5.2|June 01, 2004) at 02/03/2005 11:31:08 AM MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-SPAM: 0.00 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.184 tagged_above=0 required=5 tests=AWL, NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200502/67 X-Sequence-Number: 20178 There are not enough spaces available in the column to allow for the number of DOC_IDs. There are three spaces, allowing for at most four occurrences of DOC_ID, but there are eleven. --Rick Michael Glaesemann > cc: pgsql-sql@postgresql.org Sent by: Subject: Re: [SQL] pg primary key bug? pgsql-sql-owner@pos tgresql.org 02/03/2005 09:14 AM On Feb 3, 2005, at 21:53, pginfo wrote: > I am using pg 7.4.5 on RedHat AS 3.0. > sklad21=# \d a_constants_str > Table "public.a_constants_str" > Column | Type | Modifiers > ------------+-----------------------+----------- > constname | character varying(30) | not null > fid | integer | not null > constvalue | character varying(30) | > Indexes: > "a_constants_str_pkey" primary key, btree (constname, fid) > > sklad21=# select * from a_constants_str ; > constname | fid | constvalue -----------+-----+------------- > AACCGRID | 0 | SOF_3 > AKLTYPID | 0 | SOF_3 > ADARID | 0 | SOF_2 > AOBLASTID | 0 | SOF_6 > AUSERID | 0 | SOF_17 > ANMGRID | 0 | SOF_21 > LOCAID | 0 | SOF_41 > DOCID | 0 | SOF_1585254 > DOCPLAID | 0 | SOF_1052900 > AKLIID | 0 | SOF_18740 > DOCRID | 0 | SOF_2268142 > DOCPOGPLA | 0 | SOF_324586 > DOCID | 0 | SOF_1585254 > DOCID | 0 | SOF_1585254 > DOCID | 0 | SOF_1585254 > AKLGRID | 0 | SOF_45 > DOCID | 0 | SOF_1585254 > DOCID | 0 | SOF_1585254 > ASETUPID | 0 | SOF_4605 > DOCID | 0 | SOF_1585254 > DOCID | 0 | SOF_1585254 > TDOCID | 0 | SOF_337 > TDOCRID | 0 | SOF_19450 > DOCID | 0 | SOF_1585254 > DOCID | 0 | SOF_1585254 > AGRADID | 0 | SOF_256 > DOCID | 0 | SOF_1585254 > ASLUID | 0 | SOF_46 > NASTRF | 0 | SOF_88 > ANOMID | 0 | SOF_1200 > (30 rows) > > > Pls., see the records with 'DOCID' and note we have primary key > defined. It's unclear from just this data, but there's a chance that there are varying numbers of spaces after 'DOCID', which would appear as separate values for the index, even though they aren't readily apparent. Could you show us the results of the following query? select constname, length(constname) as constname_length from a_constants_str; Here's another one which would show if PostgreSQL is treating them equally: select constname, count(constname) from a_constants_str; The results of these queries might shed some light on the issue. Hope this helps. Michael Glaesemann grzm myrealbox com ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)