Thread

  1. Unexpected query results

    Miguel A. Juan <mjuan@cibal.es> — 2001-04-05T07:40:56Z

     Hello,
    
     I've encountered with a problem running a query that with previous releases
     worked fine.
    
     Thats the query:
     SELECT * FROM diagnostics where codigo LIKE '103.%';
    
     the string in the like statment could be any code, including any character
    in [ 'A' - 'Z', '.' , '0' - '9'].
    
     With previous releases that returns all the records that 'codigo' begins
     with '103.' but with release 7.03 this returns 0 rows. If I write  LIKE
     '103%' it works again, but I must filter for codes with the dot.
    
     The field type for codigo is character varying(6)
    
     Thanks
    
     Miguel Juan
    Mallorca - Spain
    
    
    
    
    
    
  2. Re: Unexpected query results

    Tom Lane <tgl@sss.pgh.pa.us> — 2001-04-06T05:58:48Z

    "Miguel A. Juan" <mjuan@cibal.es> writes:
    >  SELECT * FROM diagnostics where codigo LIKE '103.%';
    
    >  the string in the like statment could be any code, including any character
    > in [ 'A' - 'Z', '.' , '0' - '9'].
    
    >  With previous releases that returns all the records that 'codigo' begins
    >  with '103.' but with release 7.03 this returns 0 rows. If I write  LIKE
    >  '103%' it works again, but I must filter for codes with the dot.
    
    I suspect a locale problem.  Do you have locale support compiled, and
    if so what locale are you running the postmaster in?  Have you been
    careful always to start the postmaster with the same locale settings?
    (It's easy to blow this if you start the postmaster from a system boot
    script, since the environment of such a script is often different from
    the interactive environment where you probably started the postmaster
    the first time.)
    
    If you have an index on diagnostics(codigo), try dropping and rebuilding
    the index.  If that makes the problem go away, then you've probably been
    inconsistent about your locale setting.
    
    			regards, tom lane