Re: group by

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: YourSoft <yoursoft(at)freemail(dot)hu>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: group by
Date: 2006-05-13 17:51:51
Message-ID: 4621.1147542711@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

YourSoft <yoursoft(at)freemail(dot)hu> writes:
> 1)
> select kifejezes, count(kifejezes) from summary group by kifejezes
> having count(kifejezes)>1;
> the result is:
> kifejezes | count
> -------------------------+-------
> cscscsajok | 2
> jszszentandrs | 3
> kullancscsps | 2
> magannyugdijpenztar | 2
> magnnyugdijpnztr | 2
> magnnyugdjpnztr | 3
> magnnyugdjpnztrak | 2
> mveldsszociolgia | 2
> otp magnnyugdjpnztr | 2
> (9 rows)

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

> Why not is in the first query results the "jegygyr" (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

In response to

  • group by at 2006-05-13 13:12:55 from YourSoft

Browse pgsql-bugs by date

  From Date Subject
Next Message YourSoft 2006-05-14 08:44:32 Re: group by
Previous Message MATTASOGLIO DENIS 2006-05-13 17:39:39 BUG #2438: error connect with odbc