[英]AWS Aurora Postgres 12 Setting Collation
I am trying to set the collation on AWS Aurora Postgres 12 to a user defined collation type.我正在尝试将 AWS Aurora Postgres 12 上的排序规则设置为用户定义的排序规则类型。
CREATE COLLATION ndcoll (provider = icu, locale = 'und', deterministic = false);
I am able to create the collation just fine.我能够很好地创建排序规则。 It ends up being entered into the pg_collations table.
它最终被输入到 pg_collations 表中。
However, when I go to try to create a database using this new user defined collation, I keep receiving the error SQL Error [42809]: ERROR: invalid locale name: "ndcoll"
但是,当我尝试使用这个新的用户定义的排序规则创建数据库时,我不断收到错误
SQL Error [42809]: ERROR: invalid locale name: "ndcoll"
This is the create database statement:这是创建数据库语句:
create database "foo" with template 'bar' lc_collate = "ndcoll";
I know there is also a way to set the collation at the server level using a custom parameter group.我知道还有一种方法可以使用自定义参数组在服务器级别设置排序规则。 But the parameter group family I am using aurora-postgres 12 does not have a parameter available to set the collation.
但是我使用的参数组系列 aurora-postgres 12 没有可用于设置排序规则的参数。 After creating my user defined collation, I restarted the Aurora server, but still cannot get the DB to recognize the locale.
创建用户定义的排序规则后,我重新启动了 Aurora 服务器,但仍然无法让数据库识别语言环境。 I might be not understanding locale and lc_collate as well.
我可能也不了解 locale 和 lc_collate 。 Maybe there is a misunderstanding on my end fundamentally.
也许从根本上我有一个误解。
Does anyone have any insight as to how I can use my user defined collation either 1) to create new databases using this user defined collation or 2) set the collation at the server level to a non-deterministic collation in the aurora-postgres12 parameter group family.有没有人对我如何使用我的用户定义的排序规则有任何见解 1) 使用此用户定义的排序规则创建新数据库或 2) 将服务器级别的排序规则设置为 aurora-postgres12 参数组中的非确定性排序规则家庭。
Thanks in advance!提前致谢!
You cannot use ICU collations in a CREATE DATABASE
statement.不能在
CREATE DATABASE
语句中使用 ICU 排序规则。
That restriction may be lifted in some future PostgreSQL release.该限制可能会在未来的 PostgreSQL 版本中取消。 For now, the only way to have non-deterministic collations in PostgreSQL is to use them at the column level.
目前,在 PostgreSQL 中使用非确定性排序规则的唯一方法是在列级别使用它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.