From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-admin@postgresql.org
Subject: Re: Issues with LC_COLLATE, across 8.3/8.4 on various platforms
Date: Tue, 2 Feb 2010 17:28:39 +0200
Message-ID: <201002021728.39492.achill@matrix.gatewaynet.com> (raw)
In-Reply-To: <201002021426.44936.achill@matrix.gatewaynet.com>
References: <201002021426.44936.achill@matrix.gatewaynet.com>
It seems that libc's behaviour regarding LC_COLLATE in Linux/FreeBSD are two different stories, hence the seen results.
(Switching LC_COLLATE between en_US.UTF-8 and POSIX, in FreeBSD it does not have any impact on orderring while in Linux does)
I think i have resolved the issue, so the solution boils down to setting LC_COLLATE=C in our linux central production postgresql server.
What is the shortest way to change the default locale on a production installation running PostgreSQL-8.3.9?
Is there anything less painful than dump, initdb,restore?
I know 8.4 allows for per-db locale settings, i am just asking if there is a way to solve the issue now without waiting till
the migration to 8.4
Thanx!
Στις Tuesday 02 February 2010 14:26:44 ο/η Achilleas Mantzios έγραψε:
> Hi, i have the following problem, text ordering seems to behave incosistently across various lc_collate values, OS'es, PostgreSQL versions.
> Some behaviour might be expected, some not, thats why i am asking to see where i stand with this.
> Test Data
> postgres@dynacom=# SELECT * from test_sort_order;
> fooname
> -------------------------
> Cylinder head cover No1
> Cylinder Liner No1
> Cylinder head No1
> (3 rows)
>
> Now the query
> # SELECT * from test_sort_order order by fooname;
> in PostgreSQL 8.3.7 on x86_64-unknown-linux-gnu (lc_collate=en_US.UTF-8) gives
> fooname
> -------------------------
> Cylinder head cover No1
> Cylinder head No1
> Cylinder Liner No1
>
> while in all of
> PostgreSQL 8.3.3 on i686-pc-linux-gnu (lc_collate=C)
> PostgreSQL 8.3.7 (lc_collate=el_GR.UTF-8) on i386-unknown-freebsd6.3
> PostgreSQL 8.4.1 on x86_64-unknown-freebsd8.0 (lc_collate=en_US.UTF-8), gives
> fooname
> -------------------------
> Cylinder Liner No1
> Cylinder head No1
> Cylinder head cover No1
>
> Database encoding is SQL_ASCII in all four cases.
>
> --
> Achilleas Mantzios
>
--
Achilleas Mantzios
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: achill@matrix.gatewaynet.com
Subject: Re: Issues with LC_COLLATE, across 8.3/8.4 on various platforms
In-Reply-To: <201002021728.39492.achill@matrix.gatewaynet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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