Missing TOAST table for pg_class - Mailing list pgsql-hackers

From Fabrízio de Royes Mello
Subject Missing TOAST table for pg_class
Date
Msg-id CAFcNs+rYdnHdi5EsJFm_q1rrKse=swb=O9Fx=4dKPht6ed5EOw@mail.gmail.com
Whole thread Raw
Responses Re: Missing TOAST table for pg_class
List 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,


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

pgsql-hackers by date:

Previous
From: "tsunakawa.takay@fujitsu.com"
Date:
Subject: RE: Transactions involving multiple postgres foreign servers, take 2
Next
From: Tom Lane
Date:
Subject: Re: Lift line-length limit for pg_service.conf