小编aks*_*hay的帖子

不能索引大于缓冲区页 1/3 的值

我对 DB 不太好,所以请多多包涵。

我试图将一个很长的 JSON 数据放入一个表中,该表是由 Django 框架创建的。

我在 Heroku 上使用 Postgres。因此,当我尝试放置数据时,出现以下错误:

File "/app/.heroku/python/lib/python3.6/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
psycopg2.OperationalError: index row size 3496 exceeds maximum 2712 for index "editor_contentmodel_content_2192f49c_uniq"
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.
Run Code Online (Sandbox Code Playgroud)

我的数据库和表看起来像这样:

gollahalli-me-django-test::DATABASE=> \dt
                      List of relations
 Schema |            Name            | Type  |     Owner
--------+----------------------------+-------+----------------
 public | auth_group                 | table | …
Run Code Online (Sandbox Code Playgroud)

postgresql

9
推荐指数
1
解决办法
7703
查看次数

标签 统计

postgresql ×1