我可以配置 Aurora DB 最大标识符长度吗?如何?

Can I configure Aurora DB max identifier length? How?

我的列名很长,不管是什么原因,我需要存储非常大的列名(至少 128),因此整个行也非常大

mysql 列的严格限制为 64,行的限制为 65,535

postgresql 列的 "configurable" 限制为 63,但找不到行的限制

我的问题是: AWS Aurora 提供这两种数据库,我一直在研究但无法找到这个限制是否可以在他们的 postgresql 产品中配置,是吗?如何更改此配置?

所有 PostgreSQL 标识符(不仅仅是列名)的默认最大长度是 63 个字节(不是字符)。这个可以改,比如the manual informs where you linked:

can be increased by recompiling PostgreSQL

或在more detail here中:

The system uses no more than NAMEDATALEN-1 bytes of an identifier; longer names can be written in commands, but they will be truncated. By default, NAMEDATALEN is 64 so the maximum identifier length is 63 bytes. If this limit is problematic, it can be raised by changing the NAMEDATALEN constant in src/include/pg_config_manual.h.

相关:

  • Maximum characters in labels (table names, columns etc)

因此,虽然可以通过编辑源代码和编译来调整常规 PostgreSQL,但这显然不是 Amazon Aurora Postgres 等托管服务的选项。所以,不,您不能更改此限制。

Postgres 中 table 的所有列名的总和没有最大长度。不过,有一个 最大列数 。 1600 或更少,具体取决于数据类型。详情:

  • What is the maximum number of columns in a PostgreSQL select query