pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: pginfo <pginfo@t1.unisoftbg.com>
To: Michael Glaesemann <grzm@myrealbox.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: pg primary key bug?
Date: Thu, 03 Feb 2005 14:52:16 +0100
Message-ID: <42022C90.7090801@t1.unisoftbg.com> (raw)
References: <42021EAD.90104@t1.unisoftbg.com>
	<a284e85c43ed7f8afc4330068e42ac2f@myrealbox.com>

Hi,

It is not spaces problem.

I needet to dump the data and I deleted all rows for  'DOCID' with 
delete from a_constants_str where constname= 'DOCID'; and the pg 
reported 10 rows deleted.

Sorry I can not execute the commend now ( I dropped the data, becaus I 
needet the uniqu constnames for the restore).

regards,
ivan.


Michael Glaesemann wrote:

>
> 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
>
>
>





view thread (27+ messages)  latest in thread

Message-ID: <42022C90.7090801@t1.unisoftbg.com>
Permalink:  ../42022C90.7090801@t1.unisoftbg.com/
Also on:    postgresql.org/message-id/42022C90.7090801@t1.unisoftbg.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pginfo@t1.unisoftbg.com, grzm@myrealbox.com
  Subject: Re: pg primary key bug?
  In-Reply-To: <42022C90.7090801@t1.unisoftbg.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox