我可以配置 Aurora DB 最大标识符长度吗?如何? [英] Can I configure Aurora DB max identifier length? How?

查看:36
本文介绍了我可以配置 Aurora DB 最大标识符长度吗?如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很长的列名,无论出于何种原因,我都需要为列存储非常大的名称(至少 128 个),并且因此整个行都非常大

I have column names that are very long, regardless of the reason for this, I need to store very large names for columns (At least 128), and very large rows overall because of this

mysql 有一个强大的限制 64列和 65,535 行

mysql has a strong limit of 64 for columns and 65,535 for rows

postgresql 列的可配置"限制为 63,并且不能'找不到行

postgresql has a "configurable" limit of 63 for columns and couldn't find one for rows

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

My question is this: AWS Aurora offers both DBs, I've been researching and couldn't find whether this limit is configurable in their postgresql product, is it? How can I change this configuration?

推荐答案

所有 PostgreSQL 标识符(不仅仅是列名)的默认最大长度是 63 个字节(不是字符).这个可以改变,比如手册会告诉你链接的位置:

The default maximum length for all PostgreSQL identifiers (not just columns names) is 63 bytes (not characters). This can be changed, like the manual informs where you linked:

可以通过重新编译PostgreSQL增加

can be increased by recompiling PostgreSQL

或者在更多细节在这里:

系统使用不超过NAMEDATALEN-1 个字节的标识符;可以在命令中写入更长的名称,但它们将被截断.默认情况下,NAMEDATALEN 为 64,因此最大标识符长度为 63字节.如果此限制有问题,可以通过更改NAMEDATALEN 常量在 src/include/pg_config_manual.h 中.

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.

相关:

因此,虽然可以通过编辑源代码和编译来调整常规 PostgreSQL,但对于像 Amazon Aurora Postgres 这样的托管服务来说,这显然不是一种选择.所以,不,您不能更改此限制.

So while regular PostgreSQL can be adjusted by editing the source and compiling, this is obviously not an option for a hosted service like Amazon Aurora Postgres. So, no, you cannot change this limit.

Postgres 中一个表的所有列名的总和没有最大长度.但是有最大列数.1600 或更少,取决于数据类型.详情:

There is no maximum length for the sum of all column names of a table in Postgres. There is a maximum number of columns though. 1600 or less, depending on data types. Details:

这篇关于我可以配置 Aurora DB 最大标识符长度吗?如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆