Re: [HACKERS] Refined LC_COLLATE or multiple database clusters?

From: Honza Pazdziora <adelton(at)informatics(dot)muni(dot)cz>
To: Grega Bremec <grega(dot)bremec(at)noviforum(dot)si>
Cc: pgsql-admin(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Refined LC_COLLATE or multiple database clusters?
Date: 2004-06-09 14:43:38
Message-ID: 20040609144338.GD29863@anxur.fi.muni.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On Wed, Jun 09, 2004 at 12:33:03PM +0200, Grega Bremec wrote:
>
> Collate order for those databases, however, needs to be different. Obviously,

[...]

> Is it possible to do either of these things that could solve this problem
> adequately:
>
> - somehow manage to make one postmaster run on top of two separate
> database clusters that would each have a different collate ordering
> scheme
>
> - use some other method of initializing one database from a different
> template and taking with it LC_COLLATE setting (I suppose not, as
> the "${PGDATA}/global/" directory is global to the cluster)
>
> - use a patch that would add such functionality or upgrade to a version
> (even if release-candidate, beta is not really an option, i gather)
> of PostgreSQL that supported it
>
> - in absence of any other viable solution, change the global setting of
> the database cluster without having to dump/reinitdb/restore it

If you do not need the collating sequence to affect index operations,
you can use nls_string function to sort using

order by nls_string(column, 'sl_SI.utf-8')

where any locale can be specified in the runtime. The nls_string
result can also be used to compare strings in collating manner, however,
indexes will not be used in that case, which may or may not be a
problem for your usage.

The source of nls_string with installation instructions can be found
at

http://www.fi.muni.cz/~adelton/l10n/

--
------------------------------------------------------------------------
Honza Pazdziora | adelton(at)fi(dot)muni(dot)cz | http://www.fi.muni.cz/~adelton/
.project: Perl, mod_perl, DBI, Oracle, large Web systems, XML/XSL, ...
Only self-confident people can be simple.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Stephan Szabo 2004-06-09 14:46:09 Re: RHDB just sits and does nothing?
Previous Message Milosz Miecznik 2004-06-09 14:34:22 PostgreSQL Performance

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-06-09 14:49:20 Re: Frequently updated tables
Previous Message Thomas Hallgren 2004-06-09 14:37:56 Re: Question regarding dynamic_library_path