Re: BUG #2309: Wrong string comparison

From: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
To: Yury Don <yura(at)vpcit(dot)ru>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2309: Wrong string comparison
Date: 2006-03-10 07:36:11
Message-ID: 20060310073611.GB248@alamut
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On Mar 09 02:00, Yury Don wrote:
> Looks like string comparison operators ignore spaces isnside of string.
> Because of this sorting on text fields is wrong.
>
> mdb=# select 'a z'::text>'ad'::text;
> ?column?
> ----------
> t

PostgreSQL relies on your locale for collation. Therefore, first you
need to check if your locale settings are working. For instance:

$ TEXT="a z\nad"
$ echo -e $TEXT | LC_COLLATE=tr_TR.iso88599 sort
ad
a z
$ echo -e $TEXT | LC_COLLATE=C sort
a z
ad

Regards.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Yury Don 2006-03-10 07:57:30 Re: BUG #2309: Wrong string comparison
Previous Message Tom Lane 2006-03-10 02:47:46 Re: BUG #2311: Toast table chunk_id overflow