Add TOAST support for more system tables - Mailing list pgsql-hackers

From Sofia Kopikova
Subject Add TOAST support for more system tables
Date
Msg-id c5b7d324-0201-64a5-649b-24a78bce5224@postgrespro.ru
Whole thread Raw
Responses Re: Add TOAST support for more system tables
List pgsql-hackers
Hi, hackers!

I've tried sending this patch to community before, let me try it second
time. Patch is revised and improved compared to previous version.

This patch adds TOAST support for system tables pg_class,
pg_attribute and pg_largeobject_metadata, as they include ACL columns,
which may be potentially large in size. Patch fixes possible pg_upgrade
bug (problem with seeing a non-empty new cluster).

During code developing it turned out that heap_inplace_update function
is not suitable for use with TOAST, so its work could lead to wrong
statistics update (for example, during VACUUM). This problem is fixed
by adding new heap_inplace_update_prepare_tuple function -- we assume
TOASTed attributes are never changed by in-place update, and just
replace them with old values.

I also added pg_catalog_toast1 test that does check for "invalid tupple
length" error when creating index with toasted pg_class. Test grants and
drops roles on certain table many times to make ACL column long and then
creates index on this table.

I wonder what other bugs can happen there, but if anyone can give me a
hint, I'll try to fix them. Anyway, in PostgresPro we didn't encounter
any problems with this feature.

First attempt here:
https://www.postgresql.org/message-id/1643112264.186902312@f325.i.mail.ru

This time I'll do it better

--
Sofia Kopikova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: harmonize password reuse in vacuumdb, clusterdb, and reindexdb
Next
From: Michael Paquier
Date:
Subject: Re: ObjectIdGetDatum() missing from SearchSysCache*() callers