加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql – 标签中的最大字符(表名,列等)

发布时间:2020-12-13 16:42:28 所属栏目:百科 来源:网络整理
导读:希望这个问题以前没有问过。有谁知道域名的字符限制? 例如,如果我写这个: CREATE DOMAIN d_complement_activite_etablissement AS character varying 它将创建一个名称为: d_complement_activite_etabliss (是的,我知道如何计数,但我想要一些关于这个
希望这个问题以前没有问过。有谁知道域名的字符限制?
例如,如果我写这个:
CREATE DOMAIN d_complement_activite_etablissement AS character varying

它将创建一个名称为:

d_complement_activite_etabliss

(是的,我知道如何计数,但我想要一些关于这个问题的更多信息)。

有没有可以改变这个最大长度的命令?其他名称(列,表等)的长度是否相同?

你问:

Is there a command that can change this maximum length? Is this length
the same for other names (columns,tables etc)?

manual answers 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.

大胆强调我的

意思是改变它的唯一方法是破解源代码并重新编译PostgreSQL。
域名是任何其他标识符。当我执行:

CREATE DOMAIN d_complement_activite_etablissement_or_even_loger_than_that AS text

我得到我订购的(刚刚在PostgreSQL 8.4和9.0上测试; 9.1在这里没有什么不同):

d_complement_activite_etablissement_or_even_loger_than_that

Ergo:必须有其他一些软件裁剪你的名字。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读