pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
To: 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: Thu, 19 Sep 2024 12:00:00 +0300
Message-ID: <a97d7401-e7c9-f771-6a00-037379f0a8bb@gmail.com> (raw)
In-Reply-To: <ZusvlZBrPKm913LA@nathan>
References: <b611015f-b423-458c-aa2d-be0e655cc1b4@postgresql.org>
	<ZtipsVMZAGjrO1p_@nathan>
	<1679756.1725476893@sss.pgh.pa.us>
	<c500a379-7a20-4ab4-bcc9-5ea9aabe017a@postgresql.org>
	<ZuroEfWjxd4Zj6Yq@nathan>
	<1812111.1726671296@sss.pgh.pa.us>
	<ZusvlZBrPKm913LA@nathan>

Hello Nathan,

18.09.2024 22:52, Nathan Bossart wrote:
> Committed.  I waffled on whether to add a test for system indexes that used
> pg_index's varlena columns, but I ended up leaving it out.  I've attached
> it here in case anyone thinks we should add it.

I've discovered that Jonathan's initial script:
CREATE TABLE def (id int);
SELECT array_agg(n) b FROM generate_series(1,10_000) n \gset
CREATE OR REPLACE FUNCTION vec_quantizer (a int, b int[]) RETURNS bool
AS $$ SELECT true $$ LANGUAGE SQL IMMUTABLE;
CREATE INDEX ON def (vec_quantizer(id, :'b'));

completed with:
DROP INDEX CONCURRENTLY def_vec_quantizer_idx;

triggers an assertion failure:
TRAP: failed Assert("HaveRegisteredOrActiveSnapshot()"), File: "toast_internals.c", Line: 668, PID: 3723372

with the following stack trace:
ExceptionalCondition at assert.c:52:13
init_toast_snapshot at toast_internals.c:670:2
toast_delete_datum at toast_internals.c:429:60
toast_tuple_cleanup at toast_helper.c:303:30
heap_toast_insert_or_update at heaptoast.c:335:9
heap_update at heapam.c:3752:14
simple_heap_update at heapam.c:4210:11
CatalogTupleUpdate at indexing.c:324:2
index_set_state_flags at index.c:3522:2
index_concurrently_set_dead at index.c:1848:2
index_drop at index.c:2286:3
doDeletion at dependency.c:1362:5
deleteOneObject at dependency.c:1279:12
deleteObjectsInList at dependency.c:229:3
performMultipleDeletions at dependency.c:393:2
RemoveRelations at tablecmds.c:1594:2
ExecDropStmt at utility.c:2008:4
...

This class of assert failures is not new, see e. g., bugs #13809, #18127,
but this concrete instance (with index_set_state_flags()) emerged with
b52c4fc3c and may be worth fixing while on it...

Best regards,
Alexander

view thread (62+ messages)  latest in thread

Message-ID: <a97d7401-e7c9-f771-6a00-037379f0a8bb@gmail.com>
Permalink:  ../a97d7401-e7c9-f771-6a00-037379f0a8bb@gmail.com/
Also on:    postgresql.org/message-id/a97d7401-e7c9-f771-6a00-037379f0a8bb@gmail.com

 · 

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: exclusion@gmail.com, nathandbossart@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: <a97d7401-e7c9-f771-6a00-037379f0a8bb@gmail.com>

* 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