Char字段未指定大小的最大字符长度限制是多少?

huangapple go评论49阅读模式
英文:

What is the maximum character length limit of Char field with no specified size?

问题

Char字段没有指定大小时的默认最大字符大小限制是255个字符。

该字段的创建方式如下。

name = fields.Char(string='Name')

Odoo版本14,社区版

英文:

What is the default maximum character size limit of Char field with no specified size?

The field is created like this.

name = fields.Char(string='Name')

Odoo version 14, Community Edition

答案1

得分: 1

Odoo将使用pg_varchar函数返回提供大小的VARCHAR声明。如果未提供大小(或提供了空的或负数大小),它将返回一个无限VARCHAR,否则返回一个VARCHAR(n)

Odoo不会设置最大大小,而在PostgreSQL中可以存储的最长可能字符字符串约为1GB

英文:

Odoo will use the pg_varchar function to return the VARCHAR declaration for the provided size. If no size (or an empty or negative size) is provided, it will return an infinite VARCHAR otherwise return a VARCHAR(n)

Odoo will not set the maximum size and the longest possible character string that can be stored in PostgreSQL is about 1GB

huangapple
  • 本文由 发表于 2023年5月11日 12:34:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76224187.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定