Maximum characters in labels (table names, columns etc)

倖福魔咒の 提交于 2019-11-28 07:12:48

You ask:

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

The 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.

Bold emphasis mine.

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

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

d_complement_activite_etablissement_or_even_loger_than_that

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!