Re: Large expressions in indexes can't be stored (non-TOASTable)

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Alexander Lakhin <exclusion@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, "Jonathan S. Katz" <jkatz@postgresql.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-11-27T06:20:19Z
Lists: pgsql-hackers
On Mon, Nov 25, 2024 at 01:29:31PM -0600, Nathan Bossart wrote:
> Or we could just enforce that you have an active snapshot whenever you
> modify a catalog with a TOAST table.  That's simpler, but it requires extra
> work in some paths (and probably comments to point out that we're only
> pushing an active snapshot to satisfy an assertion).

I may be wrong, but I suspect that enforcing the check without being
column-based is the right way to go and that this is going to catch
more errors in the long-term than being a maintenance burden.  So I
would keep the snapshot check even if it's a bit aggressive, still
it's useful.  And we are not talking about that may code paths that
need to be switched to require a snapshot, as well.  Most of the ones
you have mentioned on this thread are really particular in the ways
they do transaction handling.  I suspect that it may also catch
out-of-core issues with extensions doing direct catalog manipulations.
--
Michael

Commits

  1. Ensure we have a snapshot when updating various system catalogs.

  2. Remove pg_replication_origin's TOAST table.

  3. Restrict password hash length.

  4. Ensure we have a snapshot when updating pg_index entries.

  5. Add TOAST table to pg_index.

  6. Add toast tables to most system catalogs