Hello Nathan,

Thanks for reporting this issue.

I haven't investigated this case yet, but I'll try to reproduce it as soon
as possible and look into the transaction/SPI handling around 'REPACK
(ANALYZE)'.

I'll follow up, once I got something concrete.

With best regards
Osama Abdul Qader

On Thu, 27 Aug, 2026, 7:26 pm Nathan Bossart, <[email protected]>
wrote:

> 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
>
>
>

Reply via email to