Help Center/ Relational Database Service/ Best Practices/ RDS for PostgreSQL/ Creating Databases/ FAQ/ What Do I Do If the Character Set Does Not Match the Locale During Database Creation?
Updated on 2024-09-06 GMT+08:00

What Do I Do If the Character Set Does Not Match the Locale During Database Creation?

If the LC_COLLATE you specified does not match the character set during database creation, the following error message is displayed:

CREATE DATABASE my_db2 WITH LC_COLLATE ='zh_SG' LC_CTYPE ='zh_SG' ;

Solution:

  1. Query the character set supported by the template database. For details, see How Do I View the Created Databases and the Character Sets, LC_COLLATE, and LC_CTYPE Information of the Databases?. The default template database is template1.
  2. Query the LC_COLLATE value supported by the character set. For details, see Configuring the Collation of a Database in a Locale.
  3. Change the value of LC_COLLATE to match the character set and create the database again.