错误:行太大:大小8168,最大大小8164 [英] ERROR: row is too big: size 8168, maximum size 8164

查看:102
本文介绍了错误:行太大:大小8168,最大大小8164的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PostgreSql 9.2
而且我有很多角色,并且所有角色都被授予了架构上的USAGE特权。
当我尝试创建新用户并授予特权时,收到错误消息:

I'm using PostgreSql 9.2 And i have a lot of roles, and all of them have been granted USAGE privileges on a schema. And when i try to create new user and grant privilege i receive an error:

创建角色my_user;
将架构my_schema上的GRANT USAGE授予my_user;
错误:行太大:大小8168,最大大小8164

我已经阅读了很多有关如何解决它的信息,但这是一篇非常古老的文章。
是否有修复此错误的PostgreSql(9.6.8 +)的任何新版本?

I have read a lot about how to fix it, but it was an really old articles. Is there any new version of PostgreSql (9.6.8 +) where this bug is fixed?

推荐答案

这是因为每个新权限都扩展了该模式的 pg_namespace 条目的 nspacl 列。

This is because each new permission extends the nspacl column of the pg_namespace entry for this schema.

现在PostgreSQL中的表块的大小为8kB,并且每个表行必须适合一个块,因此是限制。

Now table blocks in PostgreSQL have a size of 8kB, and each table row has to fit into one block, hence the limit.

通常不会有问题的表,因为PostgreSQL存储的是长度超出范围的可变长度的超大字段;在所谓的 TOAST 表中。但是系统目录没有TOAST表,因此该转义路径已关闭。

In normal tables that would not be a problem, because PostgreSQL stores oversized fields of variable length “out of line” in so-called TOAST tables. But there are no TOAST tables for system catalogs, so this escape route is closed.

我要说的是,由于设计不良,您正遇到这个限制。而不是授予每个角色分别对架构的访问权限,而是使用角色层次结构,将您的许多角色分配给组并在组级别授予架构权限。

I'd say that you are running into this limit because of a bad design. Rather than granting each of the roles access to the schema individually, use a hierarchy of roles, assign your many roles to groups and grant schema permissions on the group level.

这篇关于错误:行太大:大小8168,最大大小8164的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆