Thread: Port Bug Report: select doesn't find entry

Port Bug Report: select doesn't find entry

From
Unprivileged user
Date:
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               : Rob Helling
Your email address      : helling@x4u2.desy.de

Category                : runtime: back-end
Severity                : serious

Summary: select doesn't find entry

System Configuration
--------------------
  Operating System   : Linux SuSE 6.1 Kernel 2.2.5

  PostgreSQL version : 6.4.2

  Compiler used      : SuSE distributed binary

Hardware:
---------
Pentium 2, 128M RAMLinux M 2.2.5 #7 SMP Fri Jun 18 09:07:17 MEST 1999 i686 unknown


Versions of other tools:
------------------------


--------------------------------------------------------------------------

Problem Description:
--------------------
Some entries disappeared in the following way:  We have a table 'people'
is a colum 'person_key' [varchar]. In one row person_key='kristjansen' (the row exists
and can be selected using other colums) but
select * from people where person_key = 'kristjansen';
produces a null result. So does
select * from people where person_key like 'kristjansen';
But
select * from people where person_key like 'kr%istjansen';
works. The % has to be in that specific place.
The problem is there in psql and Perl (DBD interface). It is
even there if I write a perl script that selects this row using
another column extractin person_key and then asking for this
person_key:

#!/uer/local/bin/perl

require 'database.pl';

$SQL{'all_people'}   = "select * from people;";
$SQL{'still_there?'} = " select * from people where person_key='\$person_key'";

&init();

&connect_database('all_people',\@all);

foreach $guy(@all){
    $person_key = @$guy[0];
    @doll = ();
    &connect_database('still_there?',\@doll);
    print "$person_key disappeared!\n" unless @doll;
}

This happend to 4 of a few hundred rows in an unreprodicible
way.

The problem goes away when I use pgaccess to change kristjansen
manually to 'foo' and back. Could there be an invisible
character between the 'r' and the 'i'?

--------------------------------------------------------------------------

Test Case:
----------
Sorry, not known.

--------------------------------------------------------------------------

Solution:
---------


--------------------------------------------------------------------------


Re: [PORTS] Port Bug Report: select doesn't find entry

From
Thomas Lockhart
Date:
> The problem goes away when I use pgaccess to change kristjansen
> manually to 'foo' and back. Could there be an invisible
> character between the 'r' and the 'i'?

That would be my guess, though all I can say for sure is that it is
not '\0'.

                   - Thomas

--
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California

Re: [PORTS] Port Bug Report: select doesn't find entry

From
"Robert C. Helling"
Date:
On Tue, 22 Jun 1999, Thomas Lockhart wrote:

> > The problem goes away when I use pgaccess to change kristjansen
> > manually to 'foo' and back. Could there be an invisible
> > character between the 'r' and the 'i'?
>
> That would be my guess, though all I can say for sure is that it is
> not '\0'.
>

Thanks for your propt reply. But how can I make sure that this does not
persist? And: the 'invisible' character also obviously gets lost before
reaching the perl script.

Robert
--
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling        Albert Einstein Institut Potsdam
                         Max Planck Institute For Gravitational Physics
print "Just another      Fon +49 331 567 7227 Fax +49 331 567 7298
       stupid .sig\n";     http://www.aei-potsdam.mpg.de/~helling