REPACK (ANALYZE) within transaction block segfaults

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: alvherre(at)kurilemu(dot)de
Subject: REPACK (ANALYZE) within transaction block segfaults
Date: 2026-08-27 13:56:34
Message-ID: apBCEl4hBHlq0axm@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I didn't see this reported yet:

CREATE TABLE t (a INT PRIMARY KEY, b TEXT);
INSERT INTO t SELECT g, 'v' FROM generate_series(1, 100) g;
DO $$ BEGIN EXECUTE 'REPACK (ANALYZE) t'; END $$;

This produces the following output:

WARNING: transaction left non-empty SPI stack
HINT: Check for missing "SPI_finish" calls.
WARNING: snapshot 0x8ef018100 still active
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.

Presumably we need to handle transaction blocks a bit like how vacuum()
does. Or maybe even prevent REPACK (ANALYZE) within a transaction block.

--
nathan

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-08-27 14:22:13 REPACK (CONCURRENTLY) rewrites tables marked with user_catalog_table
Previous Message Sami Imseih 2026-08-27 13:33:26 Re: Fix GRAPH TABLE label and property error reporting