dbTalk Databases Forums  

[BUGS] BUG #1996: DISTINCT fails with national character varying

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1996: DISTINCT fails with national character varying in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ludmil Tinkov
 
Posts: n/a

Default [BUGS] BUG #1996: DISTINCT fails with national character varying - 10-24-2005 , 09:27 PM







The following bug has been logged online:

Bug reference: 1996
Logged by: Ludmil Tinkov
Email address: ludmil (AT) fyrex (DOT) com
PostgreSQL version: 7.3.2
Operating system: RedHat 9.0
Description: DISTINCT fails with national character varying
Details:

create table depression(ID int, name national character varying(50))

insert into depression values(1, 'Ана');
insert into depression values(2, 'Ива');
insert into depression values(3, 'Ина');
insert into depression values(4, 'Яна');

select distinct name from depression

--the last statement returns only a single row
--namely: Ана
--it should return 4 rows!

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #1996: DISTINCT fails with national character varying - 10-24-2005 , 09:47 PM






"Ludmil Tinkov" <ludmil (AT) fyrex (DOT) com> writes:
Quote:
select distinct name from depression

--the last statement returns only a single row
--namely: Ана
--it should return 4 rows!
This has been seen to happen when you select a database encoding that
does not match the encoding expected by the postmaster's LC_CTYPE locale
setting. It's really a bug in the locale definitions, if you ask me,
but good luck getting the glibc guys to change those :-(. In the
meantime, make sure your locale and encoding agree.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


Reply With Quote
  #3  
Old   
Ludmil Tinkov
 
Posts: n/a

Default Re: [BUGS] BUG #1996: DISTINCT fails with national character varying - 10-26-2005 , 08:24 AM



Thanks, Tom!

I'll tackle this issue this weekend.=20
I'll also upgrade to PostgreSQL 8 (most probably)

Thanks once again for your comprehensive reply!

Best regards,
Ludmil Tinkov

-----Original Message-----
From: Tom Lane [mailto:tgl (AT) sss (DOT) pgh.pa.us]=20
Sent: Tuesday, October 25, 2005 5:34 AM
To: Ludmil Tinkov
Cc: pgsql-bugs (AT) postgresql (DOT) org
Subject: Re: [BUGS] BUG #1996: DISTINCT fails with national character varyi=
ng=20

"Ludmil Tinkov" <ludmil (AT) fyrex (DOT) com> writes:
Quote:
select distinct name from depression

--the last statement returns only a single row
--namely: =D0=90=D0=BD=D0=B0
--it should return 4 rows!
This has been seen to happen when you select a database encoding that
does not match the encoding expected by the postmaster's LC_CTYPE locale
setting. It's really a bug in the locale definitions, if you ask me,
but good luck getting the glibc guys to change those :-(. In the
meantime, make sure your locale and encoding agree.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.