Thanks for your replies. Probably I didn't explain my problem well. I am using a third party tool which I'll be installing on Solaris machine, and that tool is using Postgres as the database. The queries are hardcoded in it and I can not change them. So right now when I do 'initdb' without specifying '-locale' or '-lc-collate', I see that the 'order by' clause returns me 'case sensitive' search.
And therefore the third party tool also returns me case sensitive results. I need postgres to be installed in a way so that 'order by' clause itself returns me 'case-insensitive' search and I don't have to use upper() or lower() functions in the query. Thanks for all your help Regards Anubha ----- Original Message ---- From: Zdenek Kotala <[email protected]> To: Anubha <anubhakhurana at yahoo.com> Cc: opensolaris-discuss at opensolaris.org Sent: Tuesday, October 7, 2008 1:03:04 AM Subject: Re: [osol-discuss] Installing postgres on Solaris with case insensitive 'order by' clause Anubha napsal(a): > Actually this is more a postgres question than a Solaris Ques? I am too new > to both Solaris and postgres, so please bear with me. > > I am installing postgres on Solaris. For that I am using initdb. > > My Objective: I want all queries that execute with ?ORDER BY? clause, to be > case-insensitive. So that, while sorting, the small ?a? and capital ?A?, are > together. > My Assumption: Some value for locale or LC_COLLATE in initdb command will > help me do this > My Problem: What should be that value? The locale value that I need to > mention with initdb is what, creating problem. So I need to have a locale > value for, I guess, LC_COLLATE which will help me do this. This is my guess. PostgreSQL uses system locales and collations. If you interesting to have case insensitive sorting you need to do something like "ORDER BY uppercase(mycol)" or you can look on http://pgfoundry.org/projects/citext/ Zdenek PS: Next time you should use databases-discuss at opensolaris.org Zdenek -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/databases-discuss/attachments/20081007/739dab60/attachment.html>
