pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Alexander Lakhin <exclusion@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jonathan S. Katz <jkatz@postgresql.org>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Large expressions in indexes can't be stored (non-TOASTable)
Date: Mon, 25 Nov 2024 13:29:31 -0600
Message-ID: <Z0TQG6869v8t-hV5@nathan> (raw)
In-Reply-To: <ZyLFC24UpcIJJmwT@paquier.xyz>
References: <ZvOMBhlb5zrBCG5p@paquier.xyz>
	<ZwV_DBQa8Qw6kKY2@nathan>
	<Zw14zoBCg-zGu1mi@nathan>
	<Zw8E73_nCk0DbO18@paquier.xyz>
	<Zw8U0YU_fu2pcXs6@nathan>
	<Zw8V0ClvZbUi2QQl@paquier.xyz>
	<Zw_hxaDoC3TzQYjj@nathan>
	<ZxGZB2d-RttHwmlt@paquier.xyz>
	<ZyKdCEaUB2lB1rG8@nathan>
	<ZyLFC24UpcIJJmwT@paquier.xyz>

On Thu, Oct 31, 2024 at 08:45:15AM +0900, Michael Paquier wrote:
> On Wed, Oct 30, 2024 at 03:54:32PM -0500, Nathan Bossart wrote:
>> I'll manage.  0001 was a doozy to back-patch, and this obviously isn't a
>> terribly pressing issue, so I plan to wait until after the November minor
>> release to apply this.
> 
> Okay by me.

I took another look at 0001, and I think it still needs a bit of work.
Specifically, IIUC a few of these code paths are actually fine since they
do not ever touch a varlena column.  For example,
clear_subscription_skip_lsn() only updates subskiplsn, so unless I am
missing a corner case, there is no risk of trying to access a TOAST table
without a snapshot.  Allowing such cases would involve adjusting the new
assertions in 0003 to check for only the varlena columns during
inserts/updates, which is more complicated but seems doable.

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'm having second thoughts on 0002, so I'll
>> probably leave that one uncommitted, but IMHO we definitely need 0003 to
>> prevent this issue from reoccurring.
> 
> I liked your idea behind 0002, FWIW.  We do that for a lot of fields
> already in a Relation.

Alright, then I'll plan on proceeding with it.

-- 
nathan





view thread (62+ messages)  latest in thread

Message-ID: <Z0TQG6869v8t-hV5@nathan>
Permalink:  ../Z0TQG6869v8t-hV5@nathan/
Also on:    postgresql.org/message-id/Z0TQG6869v8t-hV5@nathan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, michael@paquier.xyz, exclusion@gmail.com, tgl@sss.pgh.pa.us, jkatz@postgresql.org, pgsql-hackers@lists.postgresql.org
  Subject: Re: Large expressions in indexes can't be stored (non-TOASTable)
  In-Reply-To: <Z0TQG6869v8t-hV5@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox