Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS RDS: specifying lc_collate and lc_ctype for PostgreSQL

I'm trying to create a PostgreSQL database on RDS using CloudFormation. It says that all supported parameters are described in CreateDBInstance. So far I have been unable to find any parameter there or via the DB parameter groups that influences LC_COLLATE or LC_CTYPE. Those need to be specified during database creation and cannot be changed afterwards.

Right now both values will always be set to en_US.UTF-8.

like image 339
milgner Avatar asked Sep 02 '25 06:09

milgner


1 Answers

you can create database specifying those, eg:

t=# create database c LC_COLLATE 'C' LC_CTYPE 'C' template template0;
CREATE DATABASE
t=# \l+
                                                                    List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   |  Size   | Tablespace |                Description
-----------+----------+----------+-------------+-------------+-----------------------+---------+------------+--------------------------------------------
 c         | postgres | UTF8     | C           | C           |                       | 7601 kB | pg_default |
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 8157 kB | pg_default | default administrative connection database
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +| 7601 kB | pg_default | unmodifiable empty database
           |          |          |             |             | postgres=CTc/postgres |         |            |
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +| 7733 kB | pg_default | default template for new databases
           |          |          |             |             | postgres=CTc/postgres |         |            |
(4 rows)
like image 193
Vao Tsun Avatar answered Sep 04 '25 19:09

Vao Tsun