开发者

how to change Postgres Table Field name limit?

I want to create a table whose field name is of 100 characters but postgres limit for no of characters is 64 so how to change that limit to 100?

example: Create table Test ( PatientFirstnameLastNameSSNPolicyInsuraceTicketDetailEMRquestionEM开发者_如何学CR varchar(10) )

This table creation fails as the name exceeds 64 characters


Actually name's limit is equal to NAMEDATALEN - 1 bytes (not necessarily characters), default value for NAMEDATALEN is 64.

NAMEDATALEN was determined at compile time (in src/include/pg_config_manual.h). You have to recompile PostgreSQL with new NAMEDATALEN limit to make it work.

However think about design and compatibility with other servers with standard 63 bytes limit. It's not common practice to use such long names.


It's because of the special name type (see table 8.5), which is used in pg_catalog. It won't accept anything longer than 63 bytes (plus terminator). There is no workaround.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜