Re: Adding REPACK [concurrently]

From: Antonin Houska <ah(at)cybertec(dot)at>
To: Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Robert Treat <rob(at)xzilla(dot)net>
Subject: Re: Adding REPACK [concurrently]
Date: 2026-03-05 19:06:13
Message-ID: 68571.1772737573@localhost
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Antonin Houska <ah(at)cybertec(dot)at> wrote:

> Antonin Houska <ah(at)cybertec(dot)at> wrote:
>
> > Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com> wrote:
> > > ------------
> > >
> > > > attrs = palloc0_array(Datum, desc->natts);
> > > > isnull = palloc0_array(bool, desc->natts);
> > >
> > > It looks like there is a memory leak with those arrays.
> >
> > I suppose you mean store_change(). Yes, I tried to free the individual chunks
> > and forgot these. The next version uses a new, per-change memory context.
>
> I realize now that I forgot to reset the context at the end of the
> function. I'll fix that in the next version (which will probably be posted
> rather soon).

This is it. One more diff added, to engage BulkInsertState.

--
Antonin Houska
Web: https://www.cybertec-postgresql.com

Attachment Content-Type Size
v38-0001-Add-REPACK-command.patch text/x-diff 109.3 KB
v38-0002-Refactor-index_concurrently_create_copy-for-use-with.patch text/x-diff 8.7 KB
v38-0003-Add-CONCURRENTLY-option-to-REPACK-command.patch text/plain 165.0 KB
v38-0004-Serialize-decoded-tuples-without-flattening.patch text/x-diff 20.6 KB
v38-0005-Use-BulkInsertState-when-copying-data-to-the-new-hea.patch text/x-diff 6.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2026-03-05 19:27:04 Re: gistGetFakeLSN() can return incorrect LSNs
Previous Message Jeff Davis 2026-03-05 19:00:43 Re: [19] CREATE SUBSCRIPTION ... SERVER