AWS RDS:为 PostgreSQL 指定 lc_collate 和 lc_ctype
AWS RDS: specifying lc_collate and lc_ctype for PostgreSQL
我正在尝试使用 CloudFormation 在 RDS 上创建 PostgreSQL 数据库。它说所有支持的参数都在 CreateDBInstance 中描述。到目前为止,我无法在那里或通过影响 LC_COLLATE
或 LC_CTYPE
的数据库参数组找到任何参数。这些需要在创建数据库时指定,之后不能更改。
现在这两个值将始终设置为 en_US.UTF-8
。
您可以创建指定这些的数据库,例如:
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)
我正在尝试使用 CloudFormation 在 RDS 上创建 PostgreSQL 数据库。它说所有支持的参数都在 CreateDBInstance 中描述。到目前为止,我无法在那里或通过影响 LC_COLLATE
或 LC_CTYPE
的数据库参数组找到任何参数。这些需要在创建数据库时指定,之后不能更改。
现在这两个值将始终设置为 en_US.UTF-8
。
您可以创建指定这些的数据库,例如:
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)