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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Nisha Moond <nisha.moond412@gmail.com>, Euler Taveira <euler@eulerto.com>, Michael Paquier <michael@paquier.xyz>, Amit Kapila <amit.kapila16@gmail.com>, Alexander Lakhin <exclusion@gmail.com>, "Jonathan S. Katz" <jkatz@postgresql.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-04-28T22:19:19Z
Lists: pgsql-hackers
Nathan Bossart <nathandbossart@gmail.com> writes:
> On Mon, Apr 28, 2025 at 05:35:08PM -0400, Tom Lane wrote:
>> Possibly better idea: can we add something like
>> Assert(!OidIsValid(reltoastrelid)) in the code that is making this
>> assumption?

> Yeah, we could add something like that to replorigin_create() pretty
> easily.  The comment for that would be even harder to miss.

Maybe one more sentence in the code comment so that the logic is
easier to follow:

+    /*
+     * We want to be able to access pg_replication_origin without setting up a
+     * snapshot.  To make that safe, it needs to not have a TOAST table,
+     * since TOASTed data cannot be fetched without a snapshot.  As of this
+     * writing, ...

LGTM other than that nit.

			regards, tom lane



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