标签中的最大字符数(表名,列等) [英] Maximum characters in labels (table names, columns etc)

查看:116
本文介绍了标签中的最大字符数(表名,列等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望这个问题以前没有问过.有人知道域名的字符数限制吗? 例如,如果我这样写:

Hope this question wasn't asked before. Does anyone know the character limit for domain names? For example if I write this:

CREATE DOMAIN d_complement_activite_etablissement AS character varying

它将创建一个名称为

d_complement_activite_etabliss

(是的,我知道该如何计数,但是我想要更多有关该主题的信息).

(Yeah, I know how to count, but I want some more info on the subject).

是否有可以更改此最大长度的命令?其他名称(列,表格等)的长度是否相同?

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

推荐答案

您问:

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

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

此处的手动答案 :

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

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.
域名是与其他标识符一样的标识符.当我执行时:

The only way to change it is to hack the source code and recompile PostgreSQL.
Domain names are identifiers like any other. When I execute:

CREATE DOMAIN d_complement_activite_etablissement_or_even_loger_than_that AS text

我得到了订购的产品(在PostgreSQL 8.4-11上测试):

I get what I ordered (tested on PostgreSQL 8.4 - 11):

d_complement_activite_etablissement_or_even_loger_than_that

Ergo:您和您的数据库之间必须有其他软件才能剪裁名称.

Ergo: there must be some other piece of software between you and your database cropping the name.

这篇关于标签中的最大字符数(表名,列等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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