Missing TOAST table for pg_class

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Missing TOAST table for pg_class
Date: 2020-09-22 20:55:03
Message-ID: CAFcNs+rYdnHdi5EsJFm_q1rrKse=swb=O9Fx=4dKPht6ed5EOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

I know it has been discussed before [1] but one of our customers complained
about something weird on one of their multi-tenancy databases (thousands of
schemas with a lot of objects inside and one user by schema).

So when I checked the problem is because the missing TOAST for pg_class,
and is easy to break it by just:

fabrizio=# create table foo (id int);
CREATE TABLE
fabrizio=# do
$$
begin
for i in 1..2500
loop
execute 'create user u' || i;
execute 'grant all on foo to u' || i;
end loop;
end;
$$;
ERROR: row is too big: size 8168, maximum size 8160
CONTEXT: SQL statement "grant all on foo to u2445"
PL/pgSQL function inline_code_block line 6 at EXECUTE

Attached patch adds the TOAST to pg_class, and let's open again the
discussion around it.

Regards,

[1]
https://www.postgresql.org/message-id/flat/84ddff04-f122-784b-b6c5-3536804495f8%40joeconway.com

--
Fabrízio de Royes Mello Timbira - http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

Attachment Content-Type Size
add_toast_to_pg_class_v1.patch text/x-patch 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-09-22 21:24:11 Re: Lift line-length limit for pg_service.conf
Previous Message tsunakawa.takay@fujitsu.com 2020-09-22 20:42:50 RE: Transactions involving multiple postgres foreign servers, take 2