我在Django中定义了以下内容来存储纯文本PEM格式的SSL证书:
class Certificate(models.Model):
pem = models.CharField(max_length=4096, unique=True, blank=False, null=False)在Postgres中填充表列时,我看到这样一个错误,即数据的大小对于b树索引来说太大了:
django.db.utils.OperationalError: index row size 2720 exceeds btree version 4 maximum 2704 for index "app_certificate_pem_key"
DETAIL: Index row references tuple (1,6) in relation "app_certificate".
HINT: Values larger than 1/3 of a buffer page cannot be indexed.
Consider a function index of an MD5 hash of the value, or use full text indexing.是否有一种"Django“方法可以根据我的pem列的散列创建一个唯一的索引?
发布于 2020-07-31 14:28:54
似乎超出了索引宽度。尝试对pem字段进行删除索引。
https://stackoverflow.com/questions/63185204
复制相似问题