By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,821 Members | 1,030 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,821 IT Pros & Developers. It's quick & easy.

Locale support on Mac OS X

P: n/a
Hi,
I'm trying to enable italian locale support on a Mac OS X host.
I run the initdb command with the following parameters (among others):
--encoding=UNICODE --locale=it_IT.UTF-8
then I created a new test database

test_locale=# \d test_sort
Table "public.test_sort"
Column | Type | Modifiers
------------+------+-----------
text_field | text |

test_locale=# select * from test_sort;
text_field
------------
a
b
c
d
e
è
é
*
A
(9 rows)

But the order by clause yields the wrong results

test_locale=# select * from test_sort order by text_field;
text_field
------------
A
a
b
c
d
e
*
è
é
(9 rows)

Further points:
- The sort command gives the same (wrong) results.
- GUI (Cocoa) applications give the expected sort.

Any clues? Should I assume that if sort does not give the expected
result, postgresql will not be different?

Thank you in advance
--
Giorgio Valoti
--------------

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

Nov 23 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Giorgio Valoti <gi*******@mac.com> writes:
Further points:
- The sort command gives the same (wrong) results.
- GUI (Cocoa) applications give the expected sort.
Hm, that's interesting.
Any clues? Should I assume that if sort does not give the expected
result, postgresql will not be different?


Correct. I would consider it a bug if PG did not give the same sort
order as sort(1) for the same locale setting --- they'll both ultimately
depend on what the C library's strcoll() routine does. What you need to
look into is why strcoll acts differently from your Cocoa apps. Are you
certain you are really using the same locale setting for both cases?

regards, tom lane

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

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.