代码之家  ›  专栏  ›  技术社区  ›  Marcus Ilgner

AWS RDS:为PostgreSQL指定lc\U collate和lc\U ctype

  •  3
  • Marcus Ilgner  · 技术社区  · 7 年前

    我正在尝试使用CloudFormation在RDS上创建PostgreSQL数据库。它表示所有支持的参数都在 CreateDBInstance 。到目前为止,我无法在那里或通过DB参数组找到任何影响 LC_COLLATE LC_CTYPE 。这些需要在数据库创建期间指定,以后不能更改。

    现在,这两个值将始终设置为 en_US.UTF-8

    1 回复  |  直到 7 年前
        1
  •  2
  •   Vao Tsun    7 年前

    您可以创建指定这些内容的数据库,例如:

    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)