pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Locale support
6+ messages / 6 participants
[nested] [flat]

* Locale support
@ 2002-02-14 10:13 Manuel Trujillo <manueltrujillo@dorna.es>
  2002-02-14 13:21 ` Re: Locale support Jean-Michel POURE <jm.poure@freesurf.fr>
  0 siblings, 1 reply; 6+ messages in thread

From: Manuel Trujillo @ 2002-02-14 10:13 UTC (permalink / raw)
  To: pgsql-admin

Hi!

I've compiled Postgresql-7.2 with locale, recode and multibyte support.
I read the documentation about "locale" support, and I understand what
this is ussefully when I need the system/database messages in a
determinated language. Is correct this?
I need to support the japanish language, for example, and I need when a
make a query to database, with PHP, the results are in japanish.
Can the database make this directly, or I need to make this via php
programation, making a php connection with postgres with the appropiate
arguments?

Thank you very much.

-- 
Manuel Trujillo         manueltrujillo@dorna.es
Technical Engineer      http://www.motograndprix.com
Dorna Sports S.L.       +34 93 4702864




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Locale support
  2002-02-14 10:13 Locale support Manuel Trujillo <manueltrujillo@dorna.es>
@ 2002-02-14 13:21 ` Jean-Michel POURE <jm.poure@freesurf.fr>
  0 siblings, 0 replies; 6+ messages in thread

From: Jean-Michel POURE @ 2002-02-14 13:21 UTC (permalink / raw)
  To: Manuel Trujillo <manueltrujillo@dorna.es>; pgsql-admin

Le Jeudi 14 Février 2002 11:13, Manuel Trujillo a écrit :
> I need to support the japanish language, for example, and I need when a
> make a query to database, with PHP, the results are in japanish.
> Can the database make this directly, or I need to make this via php
> programation, making a php connection with postgres with the appropiate
> arguments?

You need a unicode production chain : database + php apache server. 

A single unicode database can host several languages (Arabic, Traditional 
Chinese, Russian). There is no need to use several charsets. So I assume you 
would prefer a Unicode backend.

1) Creation of a Unicode database
You can use pgAdmin (http://pgadmin.postgresql.org) to create a Unicode 
database. But pgAdmin will not display Unicode information. 

Alternatively, use psql and create a Unicode database with :
CREATE DATABASE foo WITH ENCODING = 'Unicode';

2) Apache + Php
Use Php and Apache as usual. Please note your webpages should:
a) be saved in UTF-8 format. If you need to convert web pages to Unicode, use 
iconv or recode utilities.
b) begin with <meta http-equiv="Content-Type" content="text/html; 
charset=utf-8">. This will tell the browser to switch to Unicode format.
c) Verify that your browser has Japanese fonts installed. Visit Japan Yahoo, 
this should suffice as a test.

Hope this is enough,
Cheers, Jean-Michel POURE



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* locale support
@ 2003-05-07 19:34 Jodi Kanter <jkanter@virginia.edu>
  2003-05-07 20:05 ` Re: locale support Peter Eisentraut <peter_e@gmx.net>
  2003-05-07 20:15 ` Re: locale support Bruno Wolff III <bruno@wolff.to>
  2003-05-07 20:33 ` Re: locale support Oliver Elphick <olly@lfix.co.uk>
  0 siblings, 3 replies; 6+ messages in thread

From: Jodi Kanter @ 2003-05-07 19:34 UTC (permalink / raw)
  To: pgsql-admin

Just a simple question regarding which locale setting applies to which 
type of sorting. I have two machines, production and development. The 
development machine has LC_COLLATE and LC_CTYPE set to C and the other 
has them both set to en_US.
We originally changed the development machine from en_US to C because we 
were having a problem with spaces being sorted in correctly. That has 
been fixed on the development box, but I now noticed it is sorting lower 
case letters after all capital letters. I would prefer that case is 
ignored when alphabetical sorts are completed. This type of sort is 
working correctly on the machine where both locales are set to en_US.
Does this mean that one of the above mentioned locales needs to be set 
back to en_US? I would like to have case ignored but I want to be 
careful not to mess up the sorting of spaces, which we have already 
fixed. I hate to have to test on my own and then have to reinitialize 
more than once! Please advise if you can.
Thanks
Jodi
-- 

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu <mailto:jkanter@virginia.edu>

 

 

 

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: locale support
  2003-05-07 19:34 locale support Jodi Kanter <jkanter@virginia.edu>
@ 2003-05-07 20:05 ` Peter Eisentraut <peter_e@gmx.net>
  2 siblings, 0 replies; 6+ messages in thread

From: Peter Eisentraut @ 2003-05-07 20:05 UTC (permalink / raw)
  To: Jodi Kanter <jkanter@virginia.edu>; +Cc: pgsql-admin

Jodi Kanter writes:

> We originally changed the development machine from en_US to C because we
> were having a problem with spaces being sorted in correctly. That has
> been fixed on the development box, but I now noticed it is sorting lower
> case letters after all capital letters. I would prefer that case is
> ignored when alphabetical sorts are completed. This type of sort is
> working correctly on the machine where both locales are set to en_US.

"C" gives you byte sort order (which happens to come out A..Za..z), en_US
(or any other "real" locale) gives you a more natural order that matches
what a typical dictionary would use.  If you have very particular
requirements, you can try to create your own locales.  Most modern
operating systems have support for that.

-- 
Peter Eisentraut   peter_e@gmx.net




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: locale support
  2003-05-07 19:34 locale support Jodi Kanter <jkanter@virginia.edu>
@ 2003-05-07 20:15 ` Bruno Wolff III <bruno@wolff.to>
  2 siblings, 0 replies; 6+ messages in thread

From: Bruno Wolff III @ 2003-05-07 20:15 UTC (permalink / raw)
  To: Jodi Kanter <jkanter@virginia.edu>; +Cc: pgsql-admin

On Wed, May 07, 2003 at 15:34:52 -0400,
  Jodi Kanter <jkanter@virginia.edu> wrote:
> Just a simple question regarding which locale setting applies to which 
> type of sorting. I have two machines, production and development. The 
> development machine has LC_COLLATE and LC_CTYPE set to C and the other 
> has them both set to en_US.
> We originally changed the development machine from en_US to C because we 
> were having a problem with spaces being sorted in correctly. That has 
> been fixed on the development box, but I now noticed it is sorting lower 
> case letters after all capital letters. I would prefer that case is 
> ignored when alphabetical sorts are completed. This type of sort is 
> working correctly on the machine where both locales are set to en_US.
> Does this mean that one of the above mentioned locales needs to be set 
> back to en_US? I would like to have case ignored but I want to be 
> careful not to mess up the sorting of spaces, which we have already 
> fixed. I hate to have to test on my own and then have to reinitialize 
> more than once! Please advise if you can.

You could order by the lower function and still keep the C locale.
If you need an index, you can use a functional index.




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: locale support
  2003-05-07 19:34 locale support Jodi Kanter <jkanter@virginia.edu>
@ 2003-05-07 20:33 ` Oliver Elphick <olly@lfix.co.uk>
  2 siblings, 0 replies; 6+ messages in thread

From: Oliver Elphick @ 2003-05-07 20:33 UTC (permalink / raw)
  To: Jodi Kanter <jkanter@virginia.edu>; +Cc: pgsql-admin

On Wed, 2003-05-07 at 20:34, Jodi Kanter wrote:
> Just a simple question regarding which locale setting applies to which
> type of sorting. I have two machines, production and development. The
> development machine has LC_COLLATE and LC_CTYPE set to C and the other
> has them both set to en_US. 
> We originally changed the development machine from en_US to C because
> we were having a problem with spaces being sorted in correctly. That
> has been fixed on the development box, but I now noticed it is sorting
> lower case letters after all capital letters. I would prefer that case
> is ignored when alphabetical sorts are completed. This type of sort is
> working correctly on the machine where both locales are set to en_US.
> Does this mean that one of the above mentioned locales needs to be set
> back to en_US? I would like to have case ignored but I want to be
> careful not to mess up the sorting of spaces, which we have already
> fixed. I hate to have to test on my own and then have to reinitialize
> more than once! Please advise if you can.

The sorting characteristics of C are strict ASCII order, spaces
significant.

The characteristics of en_* are dictionary order, more spaces sort after
fewer spaces:

        $ LANG=en_GB sort /tmp/ol
        fredbrooks
        fred brooks
        Fredbrooks
        Fred Brooks
        Fred  Brooks
        FredBuck
        Fred Buck
        Fred  Buck
        
        $ LANG=C sort /tmp/ol
        Fred  Brooks
        Fred  Buck
        Fred Brooks
        Fred Buck
        FredBuck
        Fredbrooks
        fred brooks
        fredbrooks

So I suspect that if you want a mixture of these characteristics, you
will have to write your own locale. Don't ask me how...

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Dearly beloved, avenge not yourselves, but rather give
      place unto wrath. For it is written, Vengeance is 
      mine; I will repay, saith the Lord. Therefore if thine
      enemy hunger, feed him; if he thirst, give him drink;
      for in so doing thou shalt heap coals of fire on his 
      head. Be not overcome of evil, but overcome evil with 
      good."      Romans 12:19-21 




^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2003-05-07 20:33 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-02-14 10:13 Locale support Manuel Trujillo <manueltrujillo@dorna.es>
2002-02-14 13:21 ` Jean-Michel POURE <jm.poure@freesurf.fr>
2003-05-07 19:34 locale support Jodi Kanter <jkanter@virginia.edu>
2003-05-07 20:05 ` Re: locale support Peter Eisentraut <peter_e@gmx.net>
2003-05-07 20:15 ` Re: locale support Bruno Wolff III <bruno@wolff.to>
2003-05-07 20:33 ` Re: locale support Oliver Elphick <olly@lfix.co.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox