Subject Re: [firebird-support] Change Collation Sets
Author Helen Borrie
At 06:34 AM 6/03/2007, you 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.

There is no such thing as a "collation
set". There is a CHARACTER SET - in your case
ISO8859_1 - that determines which set of
character images responds to the bytes that you
store in your character fields. Then, there is
COLLATION, which determines which code page your
stored data refers to. Collations generally
apply the rules that determine things like
lower-case/upper-case correspondences and the
sorting order of the characters in local dictionaries.

So - the attributes of the DATA will be no
different, since you will not be changing the CHARACTER SET.

The pieces you need to attend to are those that
have COLLATE clauses set on objects that affect
output and searching. They will typically be
distributed between your metadata (domain, field
and index definitions) and your applications
(ORDER BY and GROUP BY statements). It is likely
also that you have applied collation settings to
variables and statements in stored procedures and triggers.

By the way, you don't absolutely need a
"waterfall" approach to this change. It is quite
normal to apply different collations to different
tasks in a database, i.e. moving from the
existing case-sensitive collation to the new
case-insensitive one can be as selective as you need it to be.

./heLen