Subject Re: [firebird-support] Change Collation Sets
Author Alexandre Benson Smith
marc_guillot wrote:
> Hi.
>
> ¿ There is any simple way to change all collation sets of all string
> fields in a database ?
>
> I can only imagine to make a new empty database (with new collation
> sets defineds), pump data from old database, and backup/restore to
> reset index statistics.
>
> NOTE: Now I have ES_ES collation set in Firebird 1.0.3, and I want to
> upgrade to ES_ES_CI_AI in Firebird 2.0.1 (so I know I will have to
> bakcup/restore almost once). I will have to upgrade 60 costumers
> computers, then I am looking for the shortest way to do it.
>
> Thank you.
>

Hi,

I did it once... change to the new PT_BR collation that is AI/CI (it was
before it's officially integrated on the FB code base, we have a custom
version of FB that has this collation).

What I did:

1.) Extract database metadata
2.) Change the domains (every field definition on my DB use a domain, so
instead of changing hundreds (thousands ?) of field definitions I just
changed dozens of domains)
3.) Create a new database with this modified script
4.) Pump the data from the old to the new DB
5.) Resolve some unique indices/constraints problem that was not catched
because on non CI/AI collation
6.) run step 4 until no more problems

Note:
The problem (pointed on item 5) I got was, an unique constraint or
unique index defined on a char field, that fails on restore on the new
database because of the no diference between AI/CI. So I think an
automatic approach will be a little difficult, I did it manually on
every costumer (less than 30).

The point that Helen wrote about a gradual change is valid, but I choose
to do it all at once to have a consistent behavior on all char
searchs/ordering.

HTH

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br