Thread: PostgreSQL encoding question

PostgreSQL encoding question

From
"Anton Kalauzky"
Date:
Dear friends,

I have two PC's with exactly the same configurations - one in my office and
the other at home. They are running RedHat Linux 6.2 and PostgreSQL included
in distribution. The first one I recently installed by upgrading from Linux
6.1 and the for the second one I went through full installation process.

I have also exactly the same db's, tables and row's in PostgreSQL. All my
data's are completely equal. Recently found that when I invoke SQL command
"SELECT * FROM nst ORDER BY name;" I have different answers on my systems. I
would like to mention that I use KOI8 (RUSSIAN) encoding. The 1-st one puts
English before Russian, it's ok because they have less ASCII codes. But the
2-nd one is little strange. It sorts Russian characters truely but puts
digits and English after Russian. Here it is some outscreen:

SELECT name,id FROM nst ORDER BY name;
-----------
����
�������
���� 1971
������� 15"
Telephone
Windows

I found some SET commands but they didn't gave me any result.

So, do you have any idea about solving this problem? Thank you for your
time.

All the best.
Anton Kalauzki
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.


Re: PostgreSQL encoding question

From
Gunnar R|nning
Date:
"Anton Kalauzky" <kalauzky@hotmail.com> writes:

> Dear friends,
>
> I have two PC's with exactly the same configurations - one in my office and
> the other at home. They are running RedHat Linux 6.2 and PostgreSQL included
> in distribution. The first one I recently installed by upgrading from Linux
> 6.1 and the for the second one I went through full installation process.
>
> I have also exactly the same db's, tables and row's in PostgreSQL. All my
> data's are completely equal. Recently found that when I invoke SQL command
> "SELECT * FROM nst ORDER BY name;" I have different answers on my systems. I

Hmm. I had some similar problems with RedHat 6.2 vs. Solaris 7 with
iso-8859-1 encoding. I'm not familiar with the backend implementation, but
I think it relies on operating system libraries for correct ordering of
characters. My problem was that it sorted wrong on my development system
Redhat 6.2, while it was correct on Solaris 7. I was actually able to
reproduce the same incorrect sort order in the filesystem by using "ls". I
haven't yet made it priority to get this right on RedHat 6.2 since it is
only my development system for now, but I would sure like to hear from
anyone who has an answer to this ?

I guess this could be a similar configuration or library version problem
for you as well...

Regards,
    Gunnar


Re: [ADMIN] PostgreSQL encoding question

From
Oleg Bartunov
Date:
Anton,

you  can communicate with me in Russian.
Quick questions:
1. what's the ouput of 'psql -l'
2. Did you compile postgresql yourself and which options you
   used.
3. did you setup locale environment before starting
   postmaster
4. Could you check if locale is working on your systems


    Regards,

        Oleg
On Sat, 7 Oct 2000, Anton Kalauzky wrote:

> Date: Sat, 07 Oct 2000 08:58:42 GMT
> From: Anton Kalauzky <kalauzky@hotmail.com>
> To: pgsql-admin@postgreSQL.org, pgsql-general@postgreSQL.org
> Subject: [ADMIN] PostgreSQL encoding question
>
> Dear friends,
>
> I have two PC's with exactly the same configurations - one in my office and
> the other at home. They are running RedHat Linux 6.2 and PostgreSQL included
> in distribution. The first one I recently installed by upgrading from Linux
> 6.1 and the for the second one I went through full installation process.
>
> I have also exactly the same db's, tables and row's in PostgreSQL. All my
> data's are completely equal. Recently found that when I invoke SQL command
> "SELECT * FROM nst ORDER BY name;" I have different answers on my systems. I
> would like to mention that I use KOI8 (RUSSIAN) encoding. The 1-st one puts
> English before Russian, it's ok because they have less ASCII codes. But the
> 2-nd one is little strange. It sorts Russian characters truely but puts
> digits and English after Russian. Here it is some outscreen:
>
> SELECT name,id FROM nst ORDER BY name;
> -----------
> ВИНО
> МОНИТОР
> ВИНО 1971
> МОНИТОР 15"
> Telephone
> Windows
>
> I found some SET commands but they didn't gave me any result.
>
> So, do you have any idea about solving this problem? Thank you for your
> time.
>
> All the best.
> Anton Kalauzki
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>

_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83


Re: [ADMIN] PostgreSQL encoding question

From
Lamar Owen
Date:
Anton Kalauzky wrote:
[Problem with sort order in RH 6.1 upgraded to 6.2 versus straight 6.2
install]

> So, do you have any idea about solving this problem? Thank you for your
> time.

This is due to the collation sequence set up in RH 6.2 when you do a
fresh install.  The upgrade doesn't touch the file in question,
/etc/sysconfig/i18n.  Copy this file as it is from the fresh RH 6.2
install over to the upgraded RH 6.1 install and see what happens.

Red Hat changed, for better or for worse, the collation in RH 6.2 and
later to more closely conform to ISO standards.

Ask on pgsql-hackers, or directly e-mail teg@redhat.com for more
details.

--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

Re: Re: [ADMIN] PostgreSQL encoding question

From
teg@redhat.com (Trond Eivind Glomsrød)
Date:
Lamar Owen <lamar.owen@wgcr.org> writes:

> Anton Kalauzky wrote:
> [Problem with sort order in RH 6.1 upgraded to 6.2 versus straight 6.2
> install]
>
> > So, do you have any idea about solving this problem? Thank you for your
> > time.
>
> This is due to the collation sequence set up in RH 6.2 when you do a
> fresh install.  The upgrade doesn't touch the file in question,
> /etc/sysconfig/i18n.  Copy this file as it is from the fresh RH 6.2
> install over to the upgraded RH 6.1 install and see what happens.
>
> Red Hat changed, for better or for worse, the collation in RH 6.2 and
> later to more closely conform to ISO standards.
>
> Ask on pgsql-hackers, or directly e-mail teg@redhat.com for more
> details.

I'm reading here, and what Lamar's saying is correct.

--
Trond Eivind Glomsrød
Red Hat, Inc.