Re: group by - Mailing list pgsql-bugs

From Tom Lane
Subject Re: group by
Date
Msg-id 4621.1147542711@sss.pgh.pa.us
Whole thread Raw
In response to group by  (YourSoft <yoursoft@freemail.hu>)
List pgsql-bugs
YourSoft <yoursoft@freemail.hu> writes:
> 1)
> select kifejezes, count(kifejezes) from summary group by kifejezes
> having count(kifejezes)>1;
> the result is:
>         kifejezes        | count
> -------------------------+-------
>  csúcscsajok             |     2
>  jászszentandrás         |     3
>  kullancscsípés          |     2
>  magannyugdijpenztar     |     2
>  magánnyugdijpénztár     |     2
>  magánnyugdíjpénztár     |     3
>  magánnyugdíjpénztárak   |     2
>  művelÅdésszociológia    |     2
>  otp magánnyugdíjpénztár |     2
> (9 rows)

> 2)
> select * from summary where kifejezes like 'jegygy%';
>   kifejezes  | cnt | talalat
> ------------+-----+---------
>  jegygyürű  |   4 |       0
>  jegygyűrű  |   5 |       0
>  jegygyűrű  |   7 |       0
>  jegygyűrű  |  12 |       0
>  jegygyűrűk |   3 |       0
> (5 rows)

> Why not is in the first query results the "jegygyűrű" (second query
> rows )?

We've seen problems like this occur when you have mismatched locale and
encoding specifications --- that can confuse strcoll() to the point that
it gives inconsistent results, and since all PG character comparisons
depend on strcoll(), you get all sorts of bizarre behavior.  Check the
LC_COLLATE and LC_CTYPE settings of the database, and make sure that you
have selected a database encoding that matches them.

Also, if you're using Hungarian locale, you probably need to update to
PG 8.0.6 or later.  See bug fix list at
http://developer.postgresql.org/docs/postgres/release-8-0-6.html

            regards, tom lane

pgsql-bugs by date:

Previous
From: YourSoft
Date:
Subject: group by
Next
From: YourSoft
Date:
Subject: Re: group by