Change default collation for charset?
Posted by: Niko Huffman
Date: December 19, 2009 05:32PM

The default collation for the "utf8" character set is "utf8_general_ci" but it appears that "utf8_general_ci" is not the most effective collation for an application with multi-language support (specifically for applications that involve search-indexing).

What is the proper procedure for changing the default collation for a specific character set, so that it's not necessary to include collation on every table creation?

It looks like it would involve something akin to the following updates:

UPDATE INFORMATION_SCHEMA.CHARACTER_SETS
SET DEFAULT_COLLATE_NAME = 'utf8_unicode_ci'
WHERE CHARACTER_SET_NAME = 'utf8';

UPDATE INFORMATION_SCHEMA.COLLATIONS SET IS_DEFAULT = ''
WHERE CHARACTER_SET_NAME = 'utf8' AND COLLATION_NAME = 'utf8_general_ci';

UPDATE INFORMATION_SCHEMA.COLLATIONS SET IS_DEFAULT = 'Yes'
WHERE CHARACTER_SET_NAME = 'utf8' AND COLLATION_NAME = 'utf8_unicode_ci';

Would this work? Is it safe?

Options: ReplyQuote


Subject
Views
Written By
Posted
Change default collation for charset?
17679
December 19, 2009 05:32PM
7351
December 28, 2009 10:16PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.