Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vyE1n-00HY58-0L for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Mar 2026 19:06:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vyE1k-000sxr-3A for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Mar 2026 19:06:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vyE1j-000sxh-31 for pgsql-hackers@lists.postgresql.org; Thu, 05 Mar 2026 19:06:29 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vyE1a-00000000axN-3CJi for pgsql-hackers@lists.postgresql.org; Thu, 05 Mar 2026 19:06:27 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4838c15e3cbso76644355e9.3 for ; Thu, 05 Mar 2026 11:06:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1772737575; x=1773342375; darn=lists.postgresql.org; h=message-id:date:mime-version:comments:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=yxYSny1IeVzWLNiWyH+/CwRty3hM1RpqE7d1t85e3fE=; b=Oy7XtTdK2u91kbHdpZE8nekT9gBJ8sNOIzRfFcC98QKqqL4aPdvBrtyCErPNC9jOAx nzxiK5y+DUs3olZFNJMR/kfax6J2y6vWbMX5ylsb8/39Wajh2Nfbt0QDiSU8KqrGGJa8 bpgnGAWDETiEqUhsDkpJGv5K0v32x5D30qyAZsoVRtTXwmwtwj1KUMATC1kcObspiDuB mqPsH8sLf6kG0x98Eu/nc0KCQ/4rV9pkRnqL5wOyuPWJvp1WExATadSRUEiQSNo7RVFU T18U2jWDmvwPMh0TEwEXrgBDsKkyqSH31qV3qgjkCUdML5YeyPJ3TvraZzlrJHFCU9u2 ZeHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772737575; x=1773342375; h=message-id:date:mime-version:comments:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=yxYSny1IeVzWLNiWyH+/CwRty3hM1RpqE7d1t85e3fE=; b=JkvWh0BQfZaH9woYpxjKksEC+90pTJumxqD0V4GQvnTa2q9LUpnUuz4TKLmRek7AOa emm66nPVAZyT+U7FyuFL2eDmTUXsa1oR7BdSYrArgPeyLj22JvFCpY81hl07FlC6fMhP XjDYfMGFHBoTbMjihOeXlX0sBkjQAmcZHKsT27sz79y7Fn78L/iRZD89CZDpM3DIntQN Kc88NeFRV0ZJ7Am6FO+/cgUV5wX7KlYPsarv+6T/4P0j4iaOhonvjKXYR2BvYE1O1sH0 2T74HraD/Q1FdKv1abwApm6QBXXCTccoMQv2ABov8VztYvoPaLbayH0Vy2X1gV15fS1e gdsw== X-Forwarded-Encrypted: i=1; AJvYcCVrKGec9J+jLwM8KcDNcFzltAtkDb5X3Us9fwb28aOWLbaowKspgGcf/CIrcSCX+SbAuqdlAfOv2sukjch+@lists.postgresql.org X-Gm-Message-State: AOJu0Yypm51nrTi68gfLlkrKVfmcbMFo8aSeKRhKJGwCCyVLSwKk+ddy VAfkOWlxWF4QFP0KHYf49NHSFr+tHHyTpFEcpVaEHvJsjpifsg7HPcI8t/RT8RgnBfs= X-Gm-Gg: ATEYQzy0lftEQgWjGcM5y4BJlO8/VCC9zmi+LkK7IDzFFNhT3JQE98ZqMXClvhu9V7N tKt1EjnuggnxLZK8OPdJVkYT65aWyfwgfbMQi74K+VXT08i6Ft24FuGBuAFaPmEEU0HY3ILPXm6 8ccty2j/cWpQJCoODjmjtC0jp3KVGKZbylKiBJ/N6VZGXdcu/hT9e1/2Hp/9ZCE1hai8JvV+ZE8 o/VSU1HWjwRZIwKPktSkYVvaXvYZ3w6qED0bRcwHqjoR88VGs5km1ap9bhfonvlaZGYPYCiFSsZ 9zT7NoD9LKpZMsb6yEBJZJHlbUPJtNhI8xXIKSqgO+Iz72OLRr38UqIrqs0C/XxMl1EBIbO/SVB wH2Dup48K/QmFVCNYWO4dhbLOllLPih1BqHU4IZ9sX6LyoN8zrZFLIsWra8k2NsafILmojCkYDY l2SU71xt3niAul9i73X7CNmS6E0j+lK8UYjE+D X-Received: by 2002:a05:600c:a087:b0:485:110f:5b7f with SMTP id 5b1f17b1804b1-48519888e6amr121238855e9.19.1772737575170; Thu, 05 Mar 2026 11:06:15 -0800 (PST) Received: from localhost (109-81-168-142.rct.o2.cz. [109.81.168.142]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-485237dcf92sm1680605e9.13.2026.03.05.11.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2026 11:06:14 -0800 (PST) From: Antonin Houska To: Mihail Nikalayeu Cc: Alvaro Herrera , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] In-reply-to: <83637.1772472210@localhost> References: <202602251618.dpgvox64vziz@alvherre.pgsql> <97234.1772046253@localhost> <87648.1772217509@localhost> <67772.1772462341@localhost> <83637.1772472210@localhost> Comments: In-reply-to Antonin Houska message dated "Mon, 02 Mar 2026 18:23:30 +0100." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Thu, 05 Mar 2026 20:06:13 +0100 Message-ID: <68571.1772737573@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-=-= Content-Type: text/plain Antonin Houska wrote: > Antonin Houska wrote: > > > Mihail Nikalayeu 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 --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=v38-0001-Add-REPACK-command.patch Content-Transfer-Encoding: quoted-printable