Re: Howto change db cluster locale on-the-fly - Mailing list pgsql-hackers

From Jakub Ouhrabka
Subject Re: Howto change db cluster locale on-the-fly
Date
Msg-id 45D9AA09.4060409@comgate.cz
Whole thread Raw
In response to Re: Howto change db cluster locale on-the-fly  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Thanks for your answer. Is there any other risk than wrong answers when 
running with wrong locale?

So maybe the best bet would be:

1) drop all text/varchar user indexes
2) stop database, change the locale
3) in single user mode reindex shared tables and system tables in all 
databases and templates
4) start the database
5) create all text/varchar user indexes

Sounds this about right? I'd like to minimize downtime...

How to do step 2) - change the locale??

Thanks a lot,

Kuba

Martijn van Oosterhout napsal(a):
> On Mon, Feb 19, 2007 at 09:27:06AM +0100, Jakub Ouhrabka wrote:
>> But I guess something like this would work:
>>
>> a)
>> 1) drop all indexes on text/varchar columns
>> 2) change cluster locale
>> 3) create all indexes on text/varchar columns
> 
> You're going to miss the "name" columns, ie. every string index in
> pg_catalog. Also, there are shared tables which all used in every DB.
> You need to log into every DB in the cluster (don't forget template[01]
> and reindex everything.
> 
> So, REINDEX DATABASE; seems to be a safer bet. In general this doesn't
> actually work since changing the locale may make two strings equal that
> wern't before, thus possibly breaking a unique index, but it may be
> possible.
> 
> I'd suggest single user mode at least, and make backups!
> 
> Have a nice day,


pgsql-hackers by date:

Previous
From: Richard Levitte - VMS Whacker
Date:
Subject: Re: [Monotone-devel] Re: SCMS question
Next
From: patrick@georgi-clan.de
Date:
Subject: Re: [Monotone-devel] Re: SCMS question