Received: from home.c0de.net (209.dsl6660135.nokia.surewest.net [66.60.135.209]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB846lm32467 for ; Fri, 7 Dec 2001 23:06:48 -0500 (EST) (envelope-from phill@home.c0de.net) Received: from phill by home.c0de.net with local (Exim 3.33 #1 (Debian)) id 16CYl9-0000rm-00; Fri, 07 Dec 2001 20:06:43 -0800 Date: Fri, 7 Dec 2001 20:06:43 -0800 From: Phill Kenoyer To: Ian Barwick Cc: pgsql-admin@postgresql.org Subject: Re: Primary Key Problems Message-ID: <20011208040643.GD2913@c0de.net> References: <20011208014433.GA2913@c0de.net> <200112080246.DAA20030@post.webmailer.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200112080246.DAA20030@post.webmailer.de> User-Agent: Mutt/1.3.24i X-Archive-Number: 200112/57 X-Sequence-Number: 2781 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. |On 011207 18:51 |Ian Barwick (barwick@gmx.net) wrote the following... |Are the duplicated values in "stock" and "inventory_type" |genuinely identical? As they are both VARCHARs they could |contain differing amounts of trailing spaces or other |'invisible' characters which would not be obvious from the |console, but would represent valid and unique values |to the constraint checker. These could result from |unfiltered input, such as from an HTML form. | |Also, does the primary key still exist? | |SELECT relname, relowner FROM pg_class WHERE relname='inventory_pkey' | |Ian Barwick | -- Reason: Did you pay the new Support Fee? _ | _ (_()(|('.|)('||.|()|`|(