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-09-19T23:16:24Z
Lists: pgsql-hackers
On Thu, Sep 19, 2024 at 01:36:36PM -0500, Nathan Bossart wrote:
> +		PushActiveSnapshot(GetTransactionSnapshot());
>  
>  		/*
>  		 * Now we must wait until no running transaction could be using the
> @@ -2283,8 +2284,10 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode)
>  		 * Again, commit the transaction to make the pg_index update visible
>  		 * to other sessions.
>  		 */
> +		PopActiveSnapshot();
>  		CommitTransactionCommand();
>  		StartTransactionCommand();
> +		PushActiveSnapshot(GetTransactionSnapshot());
>  
>  		/*
>  		 * Wait till every transaction that saw the old index state has
> @@ -2387,6 +2390,8 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode)
>  	{
>  		UnlockRelationIdForSession(&heaprelid, ShareUpdateExclusiveLock);
>  		UnlockRelationIdForSession(&indexrelid, ShareUpdateExclusiveLock);
> +
> +		PopActiveSnapshot();
>  	}
>  }

Perhaps the reason why these snapshots are pushed should be documented
with a comment?
--
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